import { memo } from 'react'; import { Controller, Control } from 'react-hook-form'; import { X, Key } from 'lucide-react'; import { Input, Checkbox } from '@/components'; import { TableFormColumnSchema, TableFormSchema } from '../schema'; import { ColumnTypeSelect } from './ColumnTypeSelect'; interface TableFormColumnProps { index: number; control: Control; onRemove: () => void; isSystemColumn: boolean; isNewColumn: boolean; column: TableFormColumnSchema; } export const TableFormColumn = memo(function TableFormColumn({ index, control, onRemove, isSystemColumn, isNewColumn, column, }: TableFormColumnProps) { return (
{/* Name */}
( )} /> {column.isPrimaryKey && ( )}
{/* Type */}
{/* Default Value */}
( )} />
{/* Nullable */}
( )} />
{/* Unique */}
( )} />
{/* Delete */}
{!isSystemColumn && ( )}
); });