import { useLocal } from "lib/utils/use-local"; import { FC, useEffect } from "react"; import { PFTypes } from "./typings"; export type { PFTypes } from "./typings"; export { generateProfile } from "./utils/generate"; export const Profile: FC = ({ on_load, detail, on_delete, on_update, child, PassProp, pht__on_load, }) => { const local = useLocal( { item: {} as any, }, async () => { if (!isEditor) { const item = await on_load({ params: {}, }); local.item = item; local.render(); } else { local.item = detail({}); local.render(); } } ); useEffect(() => {}, [on_load]); return ( <> {child} ); };