Skip to content

Commit

Permalink
update empty state style
Browse files Browse the repository at this point in the history
  • Loading branch information
iamping committed Dec 27, 2024
1 parent 7275def commit 5961df0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
32 changes: 22 additions & 10 deletions src/components/app/data-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,10 @@ export const DataTable: FC<DataTableProps> = ({ data }) => {
<PanelResizeHandle className="resize-handle"></PanelResizeHandle>
</Show>
<Panel id="panel-stock" minSize={30} order={2}>
<div className="table-area" ref={parentRef}>
<div
className="table-area"
ref={parentRef}
style={{ overflow: table.getRowModel().rows.length === 0 ? 'hidden' : 'auto' }}>
<table className="table">
<thead>
{table.getHeaderGroups().map((headerGroup) => (
Expand Down Expand Up @@ -296,19 +299,28 @@ export const DataTable: FC<DataTableProps> = ({ data }) => {
</ViewportList>
</tbody>
</Show>
<Show when={table.getRowModel().rows.length === 0}>
<tbody>
<tr>
<td colSpan={table.getVisibleFlatColumns().length}>
<EmptyState
width="100vw"
position="sticky"
left={0}
right={0}
marginTop={10}
icon={<AiOutlineStock />}
title="No results found"
description="Try adjusting filters"
/>
</td>
</tr>
</tbody>
</Show>
</table>
</div>
</Panel>
</PanelGroup>
<Show when={table.getRowModel().rows.length === 0}>
<EmptyState
width="100%"
marginTop={10}
icon={<AiOutlineStock />}
title="No results found"
description="Try adjusting filters"
/>
</Show>
</>
);
};
Expand Down
1 change: 1 addition & 0 deletions src/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ body {

.table-area {
max-width: 100%;
min-height: var(--content-max-height);
max-height: var(--content-max-height);
overflow: auto;
white-space: nowrap;
Expand Down

0 comments on commit 5961df0

Please sign in to comment.