Files
jkhsakha-web/puck.config.tsx
2026-02-11 22:30:04 +09:00

34 lines
818 B
TypeScript

import type { Config } from "@puckeditor/core";
type Props = {
HeadingBlock: { title: string };
RichText: { content: string };
};
const puckConfig: Config<Props> = {
components: {
HeadingBlock: {
fields: {
title: { type: "text" },
},
defaultProps: {
title: "Heading",
},
render: ({ title }) => (
<div style={{ padding: 64 }}>
<h1>{title}</h1>
</div>
),
},
RichText: {
fields: {
content: { type: "textarea" },
},
render: ({ content }) => (
<div dangerouslySetInnerHTML={{ __html: content }} />
),
},
},
};
export default puckConfig;