Render children for data tables.
This commit is contained in:
@@ -18,6 +18,10 @@ export function WebsitesDataTable({
|
||||
}) {
|
||||
const queryResult = useWebsites({ teamId });
|
||||
|
||||
if (!queryResult?.result?.data?.length) {
|
||||
return children;
|
||||
}
|
||||
|
||||
return (
|
||||
<DataTable queryResult={queryResult}>
|
||||
{({ data }) => (
|
||||
@@ -27,9 +31,7 @@ export function WebsitesDataTable({
|
||||
showActions={showActions}
|
||||
allowEdit={allowEdit}
|
||||
allowView={allowView}
|
||||
>
|
||||
{children}
|
||||
</WebsitesTable>
|
||||
/>
|
||||
)}
|
||||
</DataTable>
|
||||
);
|
||||
|
||||
@@ -23,6 +23,10 @@ export function WebsitesTable({
|
||||
const breakpoint = useBreakpoint();
|
||||
const { renderTeamUrl } = useTeamUrl();
|
||||
|
||||
if (!data?.length) {
|
||||
return children;
|
||||
}
|
||||
|
||||
return (
|
||||
<GridTable data={data} cardMode={['xs', 'sm', 'md'].includes(breakpoint)}>
|
||||
<GridColumn name="name" label={formatMessage(labels.name)} />
|
||||
@@ -55,7 +59,6 @@ export function WebsitesTable({
|
||||
}}
|
||||
</GridColumn>
|
||||
)}
|
||||
{children}
|
||||
</GridTable>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user