feat: add basic webui
This commit is contained in:
10
packages/cms/components/body.tsx
Normal file
10
packages/cms/components/body.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import { MDXContent } from '@content-collections/mdx/react';
|
||||
import type { ComponentProps } from 'react';
|
||||
|
||||
type BodyProperties = Omit<ComponentProps<typeof MDXContent>, 'code'> & {
|
||||
content: ComponentProps<typeof MDXContent>['code'];
|
||||
};
|
||||
|
||||
export const Body = ({ content, ...props }: BodyProperties) => (
|
||||
<MDXContent {...props} code={content} />
|
||||
);
|
||||
1
packages/cms/components/image.tsx
Normal file
1
packages/cms/components/image.tsx
Normal file
@@ -0,0 +1 @@
|
||||
export { default as Image } from 'next/image';
|
||||
31
packages/cms/components/toc.tsx
Normal file
31
packages/cms/components/toc.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import { getTableOfContents } from 'fumadocs-core/server';
|
||||
|
||||
type TableOfContentsProperties = {
|
||||
data: string;
|
||||
};
|
||||
|
||||
export const TableOfContents = async ({
|
||||
data,
|
||||
}: TableOfContentsProperties) => {
|
||||
const toc = await getTableOfContents(data);
|
||||
|
||||
return (
|
||||
<ul className="flex list-none flex-col gap-2 text-sm">
|
||||
{toc.map((item) => (
|
||||
<li
|
||||
key={item.url}
|
||||
style={{
|
||||
paddingLeft: `${item.depth - 2}rem`,
|
||||
}}
|
||||
>
|
||||
<a
|
||||
href={item.url}
|
||||
className="line-clamp-3 flex rounded-sm text-foreground text-sm underline decoration-foreground/0 transition-colors hover:decoration-foreground/50"
|
||||
>
|
||||
{item.title}
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
);
|
||||
};
|
||||
1
packages/cms/components/toolbar.tsx
Normal file
1
packages/cms/components/toolbar.tsx
Normal file
@@ -0,0 +1 @@
|
||||
export const Toolbar = () => null;
|
||||
Reference in New Issue
Block a user