"use client" import { useState } from "react" import { Checkbox } from "@/components/ui/checkbox" import { ComponentContainer } from "@/components/ui/component-container" import { SectionHeading } from "@/components/ui/section-heading" export function CheckboxSection() { const [isChecked, setIsChecked] = useState(false) const checkboxProperties = [ { name: "variant", type: "select" as const, options: ["default", "card", "inline"], defaultValue: "default", label: "Variant", description: "Visual style variant", }, { name: "label", type: "text" as const, defaultValue: "Accept terms and conditions", label: "Label", description: "Label text for the checkbox", }, { name: "description", type: "text" as const, defaultValue: "", label: "Description", description: "Optional description text", }, { name: "disabled", type: "boolean" as const, defaultValue: false, label: "Disabled", description: "Whether the checkbox is disabled", }, ] const renderCheckbox = (props: Record) => { const getContainerClasses = () => { if (props.variant === "default") { // Center align when no description, top align when description is present return props.description ? "flex items-start space-x-2" : "flex items-center space-x-2" } const containerClasses = { card: "flex items-start space-x-2 p-4 border rounded-lg bg-card", inline: "flex items-center space-x-2", } return containerClasses[props.variant as keyof typeof containerClasses] } return (
{props.description && (

{props.description}

)}
) } const generateCheckboxCode = (props: Record) => { const getContainerClasses = () => { if (props.variant === "default") { return props.description ? "flex items-start space-x-2" : "flex items-center space-x-2" } const containerClasses = { card: "flex items-start space-x-2 p-4 border rounded-lg bg-card", inline: "flex items-center space-x-2", } return containerClasses[props.variant as keyof typeof containerClasses] } return `import { Checkbox } from "@/components/ui/checkbox" export function CheckboxDemo() { return (
${ props.description ? `

${props.description}

` : `` }
) }` } return (
{renderCheckbox({ variant: "default", label: "Accept terms and conditions", description: "", disabled: false, })}
) }