import type { IconType } from "react-icons"; import { TbBox, TbCirclesRelation, TbPhoto } from "react-icons/tb"; import { twMerge } from "tailwind-merge"; import { type ModalActions, ModalBody, ModalFooter, type TCreateModalSchema, type TSchemaAction, useStepContext } from "./CreateModal"; import Templates from "./templates/register"; export function StepSelect() { const { nextStep, stepBack, state, path, setState } = useStepContext(); const selected = state.action ?? null; function handleSelect(action: TSchemaAction) { if (selected === action) { nextStep(action)(); return; } setState({ action }); } return ( <>

Choose what type to add.

handleSelect("entity")} selected={selected === "entity"} /> handleSelect("relation")} selected={selected === "relation"} /> {/* handleSelect("media")} selected={selected === "media"} />*/}

Quick templates

{Templates.map(([, template]) => ( handleSelect(template.id)} selected={selected === template.id} /> ))}
); } const RadioCard = ({ Icon, title, description, onClick, selected, compact = false, disabled = false }: { Icon: IconType; title: string; description?: string; selected?: boolean; onClick?: () => void; compact?: boolean; disabled?: boolean; }) => { return (

{title}

{description}

); };