mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 08:37:13 +01:00
22 lines
717 B
TypeScript
22 lines
717 B
TypeScript
import { Flexbox } from 'react-basics';
|
|
import PageHeader from 'components/layout/PageHeader';
|
|
import { ROLES } from 'lib/constants';
|
|
import { useLogin, useMessages } from 'components/hooks';
|
|
import TeamsJoinButton from './TeamsJoinButton';
|
|
import TeamsAddButton from './TeamsAddButton';
|
|
|
|
export function TeamsHeader({ allowCreate = true }: { allowCreate?: boolean }) {
|
|
const { formatMessage, labels } = useMessages();
|
|
const { user } = useLogin();
|
|
|
|
return (
|
|
<PageHeader title={formatMessage(labels.teams)}>
|
|
<Flexbox gap={10}>
|
|
<TeamsJoinButton />
|
|
{allowCreate && user.role !== ROLES.viewOnly && <TeamsAddButton />}
|
|
</Flexbox>
|
|
</PageHeader>
|
|
);
|
|
}
|
|
|
|
export default TeamsHeader;
|