MCPcopy Create free account
hub / github.com/SplootCode/splootcode / Form

Function Form

packages/language-web/components/datasheet/datasheet.tsx:63–78  ·  view source on GitHub ↗
({ firstFieldRef, onCancel, onSave }: FormProps)

Source from the content-addressed store, hash-verified

61}
62
63const Form = ({ firstFieldRef, onCancel, onSave }: FormProps) => {
64 const ref = firstFieldRef as MutableRefObject<HTMLInputElement>
65 return (
66 <Stack spacing={4}>
67 <TextInput label="Column name" id="column-name" ref={firstFieldRef} defaultValue="New Column" />
68 <ButtonGroup d="flex" justifyContent="flex-end">
69 <Button variant="outline" onClick={onCancel}>
70 Cancel
71 </Button>
72 <Button colorScheme="teal" onClick={() => onSave(ref.current.value)}>
73 Add
74 </Button>
75 </ButtonGroup>
76 </Stack>
77 )
78}
79
80const AddColumnForm = ({ addColumn }: { addColumn: (newColumnName: string) => void }) => {
81 const { onOpen, onClose, isOpen } = useDisclosure()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected