import { useLocal } from "@/utils/use-local"; import { FC, ReactNode, useEffect } from "react"; import { Skeleton } from "../ui/skeleton"; import get from "lodash.get"; import { FieldLoading } from "../ui/field-loading"; export type BreadItem = { label: React.ReactNode; url?: string; onClick?: (ev: any) => void; }; type BreadcrumbProps = { on_load?: (e?: any) => Promise; className?: string; value?: BreadItem[]; item?: PrasiItem; }; export const Breadcrumb: FC = ({ value, className }) => { return (
{(value || []).map((cur, index): ReactNode => { const lastIndex = (value || []).length - 1; return ( <> {index === lastIndex ? (

{cur?.label}

) : (

{ if (isEditor) return; if (cur.url) navigate(cur.url || ""); if (cur.onClick) cur.onClick(ev); }} > {cur?.label}

)} {index !== lastIndex && (
)} ); })}
); };