mirror of
https://github.com/umami-software/umami.git
synced 2026-02-06 13:47:15 +01:00
New admin section.
This commit is contained in:
parent
cdf391d5c2
commit
b78ff3b477
28 changed files with 161 additions and 100 deletions
|
|
@ -25,17 +25,17 @@ export function TeamsButton({
|
|||
}) {
|
||||
const { user } = useLoginQuery();
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { result } = useTeamsQuery(user.id);
|
||||
const { data } = useTeamsQuery(user.id);
|
||||
const { teamId } = useNavigation();
|
||||
const router = useRouter();
|
||||
const team = result?.data?.find(({ id }) => id === teamId);
|
||||
const team = data?.data?.find(({ id }) => id === teamId);
|
||||
const selectedKeys = new Set([teamId || user.id]);
|
||||
|
||||
const handleSelect = (id: Key) => {
|
||||
router.push(id === user.id ? '/websites' : `/teams/${id}/websites`);
|
||||
};
|
||||
|
||||
if (!result?.count) {
|
||||
if (!data?.count) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ export function TeamsButton({
|
|||
</MenuSection>
|
||||
<MenuSeparator />
|
||||
<MenuSection title={formatMessage(labels.teams)}>
|
||||
{result?.data?.map(({ id, name }) => (
|
||||
{data?.data?.map(({ id, name }) => (
|
||||
<MenuItem key={id} id={id}>
|
||||
<Icon size="sm">
|
||||
<Users />
|
||||
|
|
|
|||
|
|
@ -29,10 +29,6 @@ export function WebsiteSelect({
|
|||
setSearch(value);
|
||||
};
|
||||
|
||||
if (!data) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Select
|
||||
{...props}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue