mirror of
https://github.com/freedbygrace/DynamoDNS.git
synced 2026-08-13 19:46:53 +00:00
cba930e4d3
Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9111ef36-26c8-4085-84ca-a35dc1fec1b5 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7083d608-d6d3-4a6a-9a27-6286c5109627/54918520-d42c-44cd-b4f4-9e5a42eb5be1.jpg
127 lines
3.3 KiB
TypeScript
127 lines
3.3 KiB
TypeScript
import * as React from "react";
|
|
import { ChevronRight, MoreHorizontal } from "lucide-react";
|
|
import { cn } from "@/lib/utils";
|
|
import { Link } from "wouter";
|
|
|
|
export interface BreadcrumbProps extends React.ComponentPropsWithoutRef<"nav"> {
|
|
separator?: React.ReactNode;
|
|
children?: React.ReactNode;
|
|
}
|
|
|
|
export interface BreadcrumbItemProps extends React.ComponentPropsWithoutRef<"li"> {
|
|
children?: React.ReactNode;
|
|
isCurrent?: boolean;
|
|
}
|
|
|
|
export interface BreadcrumbLinkProps extends React.ComponentPropsWithoutRef<"a"> {
|
|
asChild?: boolean;
|
|
children?: React.ReactNode;
|
|
href: string;
|
|
}
|
|
|
|
export interface BreadcrumbSeparatorProps extends React.ComponentPropsWithoutRef<"li"> {
|
|
children?: React.ReactNode;
|
|
}
|
|
|
|
export interface BreadcrumbEllipsisProps extends React.ComponentPropsWithoutRef<"li"> {
|
|
children?: React.ReactNode;
|
|
}
|
|
|
|
const Breadcrumb = React.forwardRef<HTMLElement, BreadcrumbProps>(
|
|
({ separator = <ChevronRight className="h-4 w-4" />, className, ...props }, ref) => {
|
|
return (
|
|
<nav
|
|
ref={ref}
|
|
aria-label="breadcrumb"
|
|
className={cn("flex flex-wrap items-center", className)}
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|
|
);
|
|
Breadcrumb.displayName = "Breadcrumb";
|
|
|
|
const BreadcrumbList = React.forwardRef<HTMLOListElement, React.ComponentPropsWithoutRef<"ol">>(
|
|
({ className, ...props }, ref) => {
|
|
return (
|
|
<ol
|
|
ref={ref}
|
|
className={cn("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5", className)}
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|
|
);
|
|
BreadcrumbList.displayName = "BreadcrumbList";
|
|
|
|
const BreadcrumbItem = React.forwardRef<HTMLLIElement, BreadcrumbItemProps>(
|
|
({ className, isCurrent, ...props }, ref) => {
|
|
return (
|
|
<li
|
|
ref={ref}
|
|
className={cn("inline-flex items-center gap-1.5", className)}
|
|
aria-current={isCurrent ? "page" : undefined}
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|
|
);
|
|
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
|
|
const BreadcrumbLink = React.forwardRef<HTMLAnchorElement, BreadcrumbLinkProps>(
|
|
({ asChild, className, href, ...props }, ref) => {
|
|
return (
|
|
<Link href={href}>
|
|
<a
|
|
ref={ref}
|
|
className={cn(
|
|
"transition-colors hover:text-foreground font-medium",
|
|
className
|
|
)}
|
|
{...props}
|
|
/>
|
|
</Link>
|
|
);
|
|
}
|
|
);
|
|
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
|
|
const BreadcrumbSeparator = React.forwardRef<HTMLLIElement, BreadcrumbSeparatorProps>(
|
|
({ className, ...props }, ref) => {
|
|
return (
|
|
<li
|
|
ref={ref}
|
|
className={cn("mx-1 text-muted-foreground", className)}
|
|
aria-hidden="true"
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|
|
);
|
|
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
|
|
const BreadcrumbEllipsis = React.forwardRef<HTMLLIElement, BreadcrumbEllipsisProps>(
|
|
({ className, ...props }, ref) => {
|
|
return (
|
|
<li
|
|
ref={ref}
|
|
className={cn("flex items-center", className)}
|
|
{...props}
|
|
>
|
|
<MoreHorizontal className="h-4 w-4" />
|
|
<span className="sr-only">More</span>
|
|
</li>
|
|
);
|
|
}
|
|
);
|
|
BreadcrumbEllipsis.displayName = "BreadcrumbEllipsis";
|
|
|
|
export {
|
|
Breadcrumb,
|
|
BreadcrumbList,
|
|
BreadcrumbItem,
|
|
BreadcrumbLink,
|
|
BreadcrumbSeparator,
|
|
BreadcrumbEllipsis,
|
|
};
|