Files
uldp.edu.vn/app/visa/components/Breadcrumb.tsx
r2xrzh9q2z-lab d53d4417b2 Initial commit
2026-02-02 11:00:08 +07:00

53 lines
1.4 KiB
TypeScript

const ASSET_URL = process.env.NEXT_PUBLIC_API_URL || "";
interface BreadcrumbProps {
title: string;
breadcrumbItems: Array<{
label: string;
href?: string;
}>;
backgroundImage?: string;
showShape?: boolean;
}
export default function Breadcrumb({
title,
breadcrumbItems,
backgroundImage = `${ASSET_URL}/assets/img/inner-page/breadcrumb.jpg`,
showShape = true,
}: BreadcrumbProps) {
return (
<section
className="breadcrumb-wrapper fix bg-cover"
style={{
backgroundImage: `url(${backgroundImage})`,
}}
>
{showShape && (
<div className="shape">
<img src={`${ASSET_URL}/assets/img/inner-page/shape.png`} alt="img" />
</div>
)}
<div className="container">
<div className="page-heading">
<h1 className="breadcrumb-title">{title}</h1>
<ul className="breadcrumb-list">
{breadcrumbItems.map((item, index) => (
<li key={index}>
{item.href ? (
<a href={item.href}>{item.label}</a>
) : (
<>
{index > 0 && <i className="fa-solid fa-chevron-right"></i>}
{item.label}
</>
)}
</li>
))}
</ul>
</div>
</div>
</section>
);
}