import { visualEditAttributes } from "@roottale/cms-renderer-next/visual-edit";

/** 인증된 미리보기에서 조회한 post의 bodyJson을 사이트의 기존 영역 reader로 해석한다. */
export function ContentAreaVisualPreview({ post, values, isPreview }: {
  post: { id: string };
  values: Record<string, string>;
  isPreview: boolean;
}) {
  return <section>
    <h2 {...visualEditAttributes({ entityId: post.id, fieldKey: "f-intro-title", path: ["f-intro-title"] }, isPreview)}>
      {values["f-intro-title"]}
    </h2>
    <p {...visualEditAttributes({ entityId: post.id, fieldKey: "f-intro-body", path: ["f-intro-body"] }, isPreview)}>
      {values["f-intro-body"]}
    </p>
  </section>;
}
