mirror of
https://github.com/umami-software/umami.git
synced 2026-02-15 01:55:36 +01:00
Updated add team website form.
This commit is contained in:
parent
c990459238
commit
a14e11bae2
18 changed files with 149 additions and 129 deletions
|
|
@ -1,43 +0,0 @@
|
|||
'use client';
|
||||
import WebsitesTable from 'app/(main)/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 Websites({
|
||||
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 Websites;
|
||||
Loading…
Add table
Add a link
Reference in a new issue