import { Type, createBlock } from "camox/createBlock"; import { Link } from "camox/navigation"; import { Button } from "@/components/ui/button"; import { cn } from "@/lib/utils"; const hero = createBlock({ id: "hero", title: "Hero", description: "Use this block as the main landing section at the top of a page. It should capture attention immediately with a clear value proposition.", content: { title: Type.String({ default: "Let's get going on {{projectName}}", title: "Title", }), description: Type.String({ default: "Press ⌘+Enter to access Camox Studio and edit content.", maxLength: 280, title: "Description", }), cta: Type.Link({ default: { text: "Get started", href: "/", newTab: false }, title: "CTA", }), illustration: Type.Image({ title: "Illustration", }), }, settings: { withIllustration: Type.Boolean({ default: true, title: "With illustration", }), theme: Type.Enum({ default: "dark", options: { light: "Light", dark: "Dark" }, title: "Theme", }), }, component: HeroComponent, toMarkdown: (c, s) => [`# ${c.title}`, c.description, s.withIllustration(c.illustration), c.cta], }); function HeroComponent() { const withIllustration = hero.useSetting("withIllustration"); const theme = hero.useSetting("theme"); return (
{(props) => (

)} {(props) =>

} {(props) =>

{withIllustration && ( {(props) => } )}
); } export { hero as block };