- 状态统一写「排队中」;「待审批」改「等你批准」,「其它」改「其他」 - 整理结果原因用「已整理 / 部分整理」;去掉引擎旧状态的「(旧)」 - 导航说明去掉「偏好标签」「留痕」等旧称与重复 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei
93 lines
2.3 KiB
TypeScript
93 lines
2.3 KiB
TypeScript
import { ChevronRight, MoreHorizontal } from "lucide-react";
|
|
import { Slot } from "radix-ui";
|
|
import type * as React from "react";
|
|
|
|
import { cn } from "~/lib/utils.ts";
|
|
|
|
function Breadcrumb({ ...props }: React.ComponentProps<"nav">) {
|
|
return <nav aria-label="页面路径" data-slot="breadcrumb" {...props} />;
|
|
}
|
|
|
|
function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">) {
|
|
return (
|
|
<ol
|
|
data-slot="breadcrumb-list"
|
|
className={cn(
|
|
"text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",
|
|
className,
|
|
)}
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">) {
|
|
return <li data-slot="breadcrumb-item" className={cn("inline-flex items-center gap-1.5", className)} {...props} />;
|
|
}
|
|
|
|
function BreadcrumbLink({
|
|
asChild,
|
|
className,
|
|
...props
|
|
}: React.ComponentProps<"a"> & {
|
|
asChild?: boolean;
|
|
}) {
|
|
const Comp = asChild ? Slot.Root : "a";
|
|
|
|
return (
|
|
<Comp data-slot="breadcrumb-link" className={cn("hover:text-foreground transition-colors", className)} {...props} />
|
|
);
|
|
}
|
|
|
|
function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">) {
|
|
return (
|
|
<span
|
|
data-slot="breadcrumb-page"
|
|
role="link"
|
|
aria-disabled="true"
|
|
aria-current="page"
|
|
className={cn("text-foreground font-normal", className)}
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<"li">) {
|
|
return (
|
|
<li
|
|
data-slot="breadcrumb-separator"
|
|
role="presentation"
|
|
aria-hidden="true"
|
|
className={cn("[&>svg]:size-3.5", className)}
|
|
{...props}
|
|
>
|
|
{children ?? <ChevronRight />}
|
|
</li>
|
|
);
|
|
}
|
|
|
|
function BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<"span">) {
|
|
return (
|
|
<span
|
|
data-slot="breadcrumb-ellipsis"
|
|
role="presentation"
|
|
aria-hidden="true"
|
|
className={cn("flex size-9 items-center justify-center", className)}
|
|
{...props}
|
|
>
|
|
<MoreHorizontal className="size-4" />
|
|
<span className="sr-only">更多</span>
|
|
</span>
|
|
);
|
|
}
|
|
|
|
export {
|
|
Breadcrumb,
|
|
BreadcrumbEllipsis,
|
|
BreadcrumbItem,
|
|
BreadcrumbLink,
|
|
BreadcrumbList,
|
|
BreadcrumbPage,
|
|
BreadcrumbSeparator,
|
|
};
|