- Updated import paths for various components to align with new directory structure. - Changed imports from 'row-actions', 'confirm-dialog', 'image-preview-button', and 'file-upload' to their respective new locations in 'data-display', 'dialogs', and 'inputs'. - Adjusted imports in multiple pages including purchase, restock, transaction, category, customer, product, raw-material, supplier, roles, and settings. - Ensured all relevant components are imported from their new locations to maintain functionality.
51 lines
1.8 KiB
TypeScript
51 lines
1.8 KiB
TypeScript
import { Link } from '@inertiajs/react';
|
|
import { Fragment } from 'react';
|
|
import {
|
|
Breadcrumb,
|
|
BreadcrumbItem,
|
|
BreadcrumbLink,
|
|
BreadcrumbList,
|
|
BreadcrumbPage,
|
|
BreadcrumbSeparator,
|
|
} from '@/components/ui/breadcrumb';
|
|
import type { BreadcrumbItem as BreadcrumbItemType } from '@/types';
|
|
|
|
export function Breadcrumbs({
|
|
breadcrumbs,
|
|
}: {
|
|
breadcrumbs: BreadcrumbItemType[];
|
|
}) {
|
|
return (
|
|
<>
|
|
{breadcrumbs.length > 0 && (
|
|
<Breadcrumb>
|
|
<BreadcrumbList>
|
|
{breadcrumbs.map((item, index) => {
|
|
const isLast = index === breadcrumbs.length - 1;
|
|
|
|
return (
|
|
<Fragment key={index}>
|
|
<BreadcrumbItem>
|
|
{isLast ? (
|
|
<BreadcrumbPage>
|
|
{item.title}
|
|
</BreadcrumbPage>
|
|
) : (
|
|
<BreadcrumbLink asChild>
|
|
<Link href={item.href}>
|
|
{item.title}
|
|
</Link>
|
|
</BreadcrumbLink>
|
|
)}
|
|
</BreadcrumbItem>
|
|
{!isLast && <BreadcrumbSeparator />}
|
|
</Fragment>
|
|
);
|
|
})}
|
|
</BreadcrumbList>
|
|
</Breadcrumb>
|
|
)}
|
|
</>
|
|
);
|
|
}
|