Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfeng33 committed Dec 19, 2024
1 parent d5fbdbf commit 3fde2f4
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions apps/www/src/registry/default/block/slate-to-html/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ import {
BaseTableRowPlugin,
} from '@udecode/plate-table';
import { BaseTogglePlugin } from '@udecode/plate-toggle';
import fs from 'node:fs/promises';
import path from 'node:path';
import Prism from 'prismjs';

import { H3 } from '@/components/typography';
Expand Down Expand Up @@ -134,17 +132,17 @@ export const iframeHeight = '800px';

export const containerClassName = 'w-full h-full';

const getCachedTailwindCss = React.cache(async () => {
const cssPath = path.join(process.cwd(), 'public', 'tailwind.css');
// const getCachedTailwindCss = React.cache(async () => {
// const cssPath = path.join(process.cwd(), 'public', 'tailwind.css');

return await fs.readFile(cssPath, 'utf8');
});
// return await fs.readFile(cssPath, 'utf8');
// });

const getCachedPrismCss = React.cache(async () => {
const cssPath = path.join(process.cwd(), 'public', 'prism.css');
// const getCachedPrismCss = React.cache(async () => {
// const cssPath = path.join(process.cwd(), 'public', 'prism.css');

return await fs.readFile(cssPath, 'utf8');
});
// return await fs.readFile(cssPath, 'utf8');
// });

export default async function SlateToHtmlBlock() {
const components = {
Expand Down Expand Up @@ -298,11 +296,13 @@ export default async function SlateToHtmlBlock() {
value: createValue(),
});

const tailwindCss = await getCachedTailwindCss();
const prismCss = await getCachedPrismCss();
// const tailwindCss = await getCachedTailwindCss();
// const prismCss = await getCachedPrismCss();
// const cookieStore = await cookies();
// const theme = cookieStore.get('theme')?.value;
const theme = 'light';
const prismCss = '';
const tailwindCss = '';

// Get the editor content HTML using EditorStatic
const editorHtml = await serializeHtml(editor, {
Expand Down

0 comments on commit 3fde2f4

Please sign in to comment.