mirror of
https://github.com/umami-software/umami.git
synced 2026-02-23 05:55:35 +01:00
Added teams pages. Refactored hooks.
This commit is contained in:
parent
a2c202fa36
commit
9448aa3ab5
136 changed files with 387 additions and 287 deletions
|
|
@ -1,27 +1,7 @@
|
|||
import WebsitesTable from 'app/(main)/settings/websites/WebsitesTable';
|
||||
import DataTable from 'components/common/DataTable';
|
||||
import useFilterQuery from 'components/hooks/useFilterQuery';
|
||||
import useApi from 'components/hooks/useApi';
|
||||
import useUser from 'components/hooks/useUser';
|
||||
import useCache from 'store/cache';
|
||||
import WebsitesDataTable from 'app/(main)/settings/websites/WebsitesDataTable';
|
||||
|
||||
export function TeamWebsites({ teamId }: { teamId: string; readOnly: boolean }) {
|
||||
const { get } = useApi();
|
||||
const { user } = useUser();
|
||||
const modified = useCache(state => state?.['team:websites']);
|
||||
const queryResult = useFilterQuery({
|
||||
queryKey: ['team:websites', { teamId, modified }],
|
||||
queryFn: params => {
|
||||
return get(`/teams/${teamId}/websites`, {
|
||||
...params,
|
||||
});
|
||||
},
|
||||
enabled: !!user,
|
||||
});
|
||||
|
||||
return (
|
||||
<DataTable queryResult={queryResult}>{({ data }) => <WebsitesTable data={data} />}</DataTable>
|
||||
);
|
||||
return <WebsitesDataTable teamId={teamId} />;
|
||||
}
|
||||
|
||||
export default TeamWebsites;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue