mirror of
https://github.com/Shadowfita/docmost.git
synced 2025-11-16 01:31:09 +10:00
switch to nx monorepo
This commit is contained in:
27
apps/client/src/pages/page/page.tsx
Normal file
27
apps/client/src/pages/page/page.tsx
Normal file
@ -0,0 +1,27 @@
|
||||
import { useParams } from 'react-router-dom';
|
||||
import { usePageQuery } from '@/features/page/queries/page-query';
|
||||
import { FullEditor } from '@/features/editor/full-editor';
|
||||
import HistoryModal from '@/features/page-history/components/history-modal';
|
||||
|
||||
export default function Page() {
|
||||
const { pageId } = useParams();
|
||||
const { data, isLoading, isError } = usePageQuery(pageId);
|
||||
|
||||
if (isLoading) {
|
||||
return <></>;
|
||||
}
|
||||
|
||||
if (isError || !data) { // TODO: fix this
|
||||
return <div>Error fetching page data.</div>;
|
||||
}
|
||||
|
||||
return (
|
||||
data && (
|
||||
<div>
|
||||
<FullEditor pageId={pageId} title={data.title} />
|
||||
<HistoryModal />
|
||||
</div>
|
||||
)
|
||||
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user