diff --git a/app/page.tsx b/app/page.tsx index 26a7741..418d339 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -17,14 +17,14 @@ interface Person { const Home: FC = () => { const [code, setCode] = useState(DEFAULT_INTERFACE); - const [selectedKeys, setSelectedKeys] = useState(new Set(['10'])); + const [numberOfRows, setNumberOfRows] = useState(new Set(['10'])); const handleOnGenerate = (): void => { console.log('*********', code); }; const handleOnRowCountChange = (newRowCount: any): void => { - setSelectedKeys(newRowCount); + setNumberOfRows(newRowCount); }; const handleOnCodeChange = (newCode: string): void => { setCode(newCode); @@ -34,7 +34,7 @@ const Home: FC = () => {
diff --git a/components/header/index.tsx b/components/header/index.tsx index 96279e7..89e7862 100644 --- a/components/header/index.tsx +++ b/components/header/index.tsx @@ -11,13 +11,13 @@ import { type Props = { onGenerate: () => void; onRowCountChange: (rowCount: Selection) => void; - selectedKeys: any; + numberOfRows: any; }; -const Header: FC = ({ onGenerate, onRowCountChange, selectedKeys }) => { +const Header: FC = ({ onGenerate, onRowCountChange, numberOfRows }) => { const selectedValue = React.useMemo( - () => Array.from(selectedKeys).join(', ').replaceAll('_', ' '), - [selectedKeys], + () => Array.from(numberOfRows).join(', ').replaceAll('_', ' '), + [numberOfRows], ); return ( @@ -37,7 +37,7 @@ const Header: FC = ({ onGenerate, onRowCountChange, selectedKeys }) => { variant='flat' disallowEmptySelection selectionMode='single' - selectedKeys={selectedKeys} + selectedKeys={numberOfRows} onSelectionChange={onRowCountChange} > 10