import { useEffect, useState } from 'react'; import { Frame } from '../../components/frame'; import { Skeleton } from '@nextui-org/react'; import { Content } from '../../components/content'; type Props = { content: () => Promise<{ Page: (props: any) => JSX.Element }>; }; const Page = ({ content }: Props) => { const [Component, setComponent] = useState(); useEffect(() => { const run = async () => { const component = await content(); setComponent(() => component.Page); }; run(); }, [content]); return ( {!!Component ? (
) : (
)}
); }; export { Page };