mirror of
https://github.com/umami-software/umami.git
synced 2026-02-16 18:45:36 +01:00
Refactored to use app folder.
This commit is contained in:
parent
40cfcd41e9
commit
9a52cdd2e1
258 changed files with 2025 additions and 2258 deletions
43
src/app/(app)/settings/websites/WebsitesList.js
Normal file
43
src/app/(app)/settings/websites/WebsitesList.js
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
'use client';
|
||||
import WebsitesTable from 'app/(app)/settings/websites/WebsitesTable';
|
||||
import useUser from 'components/hooks/useUser';
|
||||
import useApi from 'components/hooks/useApi';
|
||||
import DataTable from 'components/common/DataTable';
|
||||
import useFilterQuery from 'components/hooks/useFilterQuery';
|
||||
import WebsitesHeader from './WebsitesHeader';
|
||||
|
||||
export function WebsitesList({
|
||||
showHeader = true,
|
||||
showEditButton = true,
|
||||
showTeam,
|
||||
includeTeams,
|
||||
onlyTeams,
|
||||
}) {
|
||||
const { user } = useUser();
|
||||
const { get } = useApi();
|
||||
const filterQuery = useFilterQuery(
|
||||
['websites', { includeTeams, onlyTeams }],
|
||||
params => {
|
||||
return get(`/users/${user?.id}/websites`, {
|
||||
includeTeams,
|
||||
onlyTeams,
|
||||
...params,
|
||||
});
|
||||
},
|
||||
{ enabled: !!user },
|
||||
);
|
||||
const { getProps } = filterQuery;
|
||||
|
||||
return (
|
||||
<>
|
||||
{showHeader && <WebsitesHeader />}
|
||||
<DataTable {...getProps()}>
|
||||
{({ data }) => (
|
||||
<WebsitesTable data={data} showTeam={showTeam} showEditButton={showEditButton} />
|
||||
)}
|
||||
</DataTable>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default WebsitesList;
|
||||
Loading…
Add table
Add a link
Reference in a new issue