mirror of
https://github.com/docmost/docmost.git
synced 2026-08-29 01:37:05 +08:00
feat: bases
Add the bases feature: formula engine package, grid/table UI, and the base-embed editor extension, with supporting client and server changes.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { useParams } from "react-router-dom";
|
||||
import { Container, Title, Text, Stack } from "@mantine/core";
|
||||
import { BaseView } from "@/ee/base/components/base-view";
|
||||
import { useBaseQuery } from "@/ee/base/queries/base-query";
|
||||
import { useHasFeature } from "@/ee/hooks/use-feature";
|
||||
import { Feature } from "@/ee/features";
|
||||
|
||||
export default function BasePage() {
|
||||
const { pageId } = useParams<{ pageId: string }>();
|
||||
const hasBases = useHasFeature(Feature.BASES);
|
||||
const { data: base } = useBaseQuery(pageId ?? "");
|
||||
|
||||
if (!pageId) {
|
||||
return (
|
||||
<Stack align="center" p="xl">
|
||||
<Text c="dimmed">No base ID provided</Text>
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Container
|
||||
fluid
|
||||
p="md"
|
||||
style={{ height: "calc(100vh - 60px)", display: "flex", flexDirection: "column" }}
|
||||
>
|
||||
{base && (
|
||||
<Title order={3} mb="xs">
|
||||
{base.icon ? `${base.icon} ` : ""}{base.name}
|
||||
</Title>
|
||||
)}
|
||||
<BaseView pageId={pageId} editable={hasBases && (base?.canEdit ?? false)} />
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user