Skip to content

Commit cedba50

Browse files
committed
refactor(Dashboards): improve conditional rendering and enhance user feedback for empty state
1 parent af1dd03 commit cedba50

File tree

1 file changed

+10
-7
lines changed
  • app/[locale]/dashboard/[entityType]/[entitySlug]/usecases/edit/[id]/publish

1 file changed

+10
-7
lines changed

app/[locale]/dashboard/[entityType]/[entitySlug]/usecases/edit/[id]/publish/Dashboards.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { Table } from 'opub-ui';
2-
1+
import { Table, Text } from 'opub-ui';
32

43
const Dashboards = ({ data }: { data: any }) => {
54
const dashboardColumns = [
@@ -17,11 +16,15 @@ const Dashboards = ({ data }: { data: any }) => {
1716
};
1817
return (
1918
<div>
20-
<Table
21-
columns={dashboardColumns}
22-
rows={generatePublisherData(data)}
23-
hideFooter
24-
/>
19+
{data?.length > 0 ? (
20+
<Table
21+
columns={dashboardColumns}
22+
rows={generatePublisherData(data)}
23+
hideFooter
24+
/>
25+
) : (
26+
<Text variant="bodyMd">No Dashboards Found</Text>
27+
)}
2528
</div>
2629
);
2730
};

0 commit comments

Comments
 (0)