import type { FieldConfig } from '../lib/templates'; type PropFieldsProps = { fields: Record; values: Record; onChange: (key: string, value: unknown) => void; }; export const PropFields = ({ fields, values, onChange }: PropFieldsProps) => { const entries = Object.entries(fields); if (entries.length === 0) { return

No editable props.

; } return (
{entries.map(([key, field]) => ( onChange(key, value)} /> ))}
); }; type PropFieldProps = { name: string; field: FieldConfig; value: unknown; onChange: (value: unknown) => void; }; const inputClass = 'w-full rounded-md border border-neutral-300 bg-white px-2 py-1 text-neutral-900 text-xs focus:border-neutral-500 focus:outline-none'; const PropField = ({ name, field, value, onChange }: PropFieldProps) => { const id = `prop-${name}`; return (
{field.type === 'text' && ( onChange(event.target.value)} /> )} {field.type === 'textarea' && (