mirror of
https://github.com/docmost/docmost.git
synced 2026-05-18 23:44:24 +08:00
670ee64179
* feat: support i18n * feat: wip support i18n * feat: complete space translation * feat: complete page translation * feat: update space translation * feat: update workspace translation * feat: update group translation * feat: update workspace translation * feat: update page translation * feat: update user translation * chore: update pnpm-lock * feat: add query translation * refactor: merge to single file * chore: remove necessary code * feat: save language to BE * fix: only load current language * feat: save language to locale column * fix: cleanups * add language menu to preferences page * new translations * translate editor * Translate editor placeholders * translate space selection component --------- Co-authored-by: Philip Okugbe <phil@docmost.com> Co-authored-by: Philip Okugbe <16838612+Philipinho@users.noreply.github.com>
41 lines
1.3 KiB
TypeScript
41 lines
1.3 KiB
TypeScript
import { useGroupQuery } from "@/features/group/queries/group-query";
|
|
import { useParams } from "react-router-dom";
|
|
import { Group, Title, Text } from "@mantine/core";
|
|
import AddGroupMemberModal from "@/features/group/components/add-group-member-modal";
|
|
import React from "react";
|
|
import { useDisclosure } from "@mantine/hooks";
|
|
import EditGroupModal from "@/features/group/components/edit-group-modal.tsx";
|
|
import GroupActionMenu from "@/features/group/components/group-action-menu.tsx";
|
|
import useUserRole from "@/hooks/use-user-role.tsx";
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
export default function GroupDetails() {
|
|
const { groupId } = useParams();
|
|
const { data: group, isLoading } = useGroupQuery(groupId);
|
|
const [opened, { open, close }] = useDisclosure(false);
|
|
const { isAdmin } = useUserRole();
|
|
|
|
return (
|
|
<>
|
|
{group && (
|
|
<div>
|
|
{/* Todo: back navigation */}
|
|
<Title order={4}>{group.name}</Title>
|
|
<Text c="dimmed">{group.description}</Text>
|
|
|
|
<Group my="md" justify="flex-end">
|
|
{isAdmin && (
|
|
<>
|
|
<AddGroupMemberModal />
|
|
<GroupActionMenu />
|
|
</>
|
|
)}
|
|
</Group>
|
|
</div>
|
|
)}
|
|
|
|
<EditGroupModal opened={opened} onClose={close} />
|
|
</>
|
|
);
|
|
}
|