mirror of
https://github.com/umami-software/umami.git
synced 2026-02-23 14:05:35 +01:00
Changed Admin tab to Manage.
This commit is contained in:
parent
91e3dff7f5
commit
642aba83e5
55 changed files with 59 additions and 59 deletions
33
src/app/(main)/settings/teams/[teamId]/team/TeamManage.tsx
Normal file
33
src/app/(main)/settings/teams/[teamId]/team/TeamManage.tsx
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import { useMessages, useModified } from 'components/hooks';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { ActionForm, Button, Modal, ModalTrigger } from 'react-basics';
|
||||
import TeamDeleteForm from './TeamDeleteForm';
|
||||
|
||||
export function TeamManage({ teamId }: { teamId: string }) {
|
||||
const { formatMessage, labels, messages } = useMessages();
|
||||
const router = useRouter();
|
||||
const { touch } = useModified();
|
||||
|
||||
const handleLeave = async () => {
|
||||
touch('teams');
|
||||
router.push('/settings/teams');
|
||||
};
|
||||
|
||||
return (
|
||||
<ActionForm
|
||||
label={formatMessage(labels.deleteTeam)}
|
||||
description={formatMessage(messages.deleteTeamWarning)}
|
||||
>
|
||||
<ModalTrigger>
|
||||
<Button variant="danger">{formatMessage(labels.delete)}</Button>
|
||||
<Modal title={formatMessage(labels.deleteTeam)}>
|
||||
{(close: () => void) => (
|
||||
<TeamDeleteForm teamId={teamId} onSave={handleLeave} onClose={close} />
|
||||
)}
|
||||
</Modal>
|
||||
</ModalTrigger>
|
||||
</ActionForm>
|
||||
);
|
||||
}
|
||||
|
||||
export default TeamManage;
|
||||
Loading…
Add table
Add a link
Reference in a new issue