♻️ (tableComponent): remove unnecessary comma and autoHeight property
✨ (ShortcutsPage): add conditional rendering for TableComponent to handle empty data
This commit is contained in:
parent
bc6304b338
commit
63497586d8
2 changed files with 14 additions and 13 deletions
|
|
@ -141,7 +141,6 @@ const TableComponent = forwardRef<
|
|||
{...props}
|
||||
defaultColDef={{
|
||||
minWidth: 100,
|
||||
autoHeight: true,
|
||||
}}
|
||||
animateRows={false}
|
||||
columnDefs={colDef}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ export default function ShortcutsPage() {
|
|||
const combinationToEdit = shortcuts.filter((s) => s.name === selectedRows[0]);
|
||||
const [open, setOpen] = useState(false);
|
||||
const updateUniqueShortcut = useShortcutsStore(
|
||||
(state) => state.updateUniqueShortcut
|
||||
(state) => state.updateUniqueShortcut,
|
||||
);
|
||||
|
||||
function handleRestore() {
|
||||
|
|
@ -97,17 +97,19 @@ export default function ShortcutsPage() {
|
|||
</div>
|
||||
<div className="grid gap-6 pb-8">
|
||||
<div>
|
||||
<TableComponent
|
||||
suppressRowClickSelection={true}
|
||||
domLayout="autoHeight"
|
||||
pagination={false}
|
||||
columnDefs={colDefs}
|
||||
rowData={nodesRowData}
|
||||
onCellDoubleClicked={(e) => {
|
||||
setSelectedRows([e.data.name]);
|
||||
setOpen(true);
|
||||
}}
|
||||
/>
|
||||
{colDefs && nodesRowData.length > 0 && (
|
||||
<TableComponent
|
||||
suppressRowClickSelection={true}
|
||||
domLayout="autoHeight"
|
||||
pagination={false}
|
||||
columnDefs={colDefs}
|
||||
rowData={nodesRowData}
|
||||
onCellDoubleClicked={(e) => {
|
||||
setSelectedRows([e.data.name]);
|
||||
setOpen(true);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue