umami/src/app/(main)/settings/websites/WebsitesDataTable.tsx

39 lines
872 B
TypeScript
Raw Normal View History

2024-01-29 02:33:40 +00:00
import { ReactNode } from 'react';
2023-10-03 23:05:17 +00:00
import WebsitesTable from 'app/(main)/settings/websites/WebsitesTable';
2023-09-29 12:29:22 +00:00
import DataTable from 'components/common/DataTable';
2024-01-29 11:15:22 +00:00
import { useWebsites } from 'components/hooks';
2023-10-08 05:42:49 +00:00
2023-12-06 03:22:14 +00:00
export function WebsitesDataTable({
2024-01-29 02:33:40 +00:00
teamId,
2023-12-06 03:22:14 +00:00
allowEdit = true,
allowView = true,
showActions = true,
children,
2024-01-29 11:15:22 +00:00
}: {
teamId?: string;
allowEdit?: boolean;
allowView?: boolean;
showActions?: boolean;
children?: ReactNode;
}) {
2024-02-19 19:31:11 +00:00
const queryResult = useWebsites({ teamId });
2023-09-29 12:29:22 +00:00
return (
2023-10-08 01:55:14 +00:00
<DataTable queryResult={queryResult}>
{({ data }) => (
<WebsitesTable
2024-01-29 11:15:22 +00:00
teamId={teamId}
2023-10-08 01:55:14 +00:00
data={data}
showActions={showActions}
allowEdit={allowEdit}
allowView={allowView}
>
{children}
</WebsitesTable>
)}
</DataTable>
2023-09-29 12:29:22 +00:00
);
}
2023-10-04 08:46:00 +00:00
export default WebsitesDataTable;