feat: shared back navigation on detail pages
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import Link from "next/link";
|
||||
import { ArrowLeft } from "lucide-react";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
type DetailBackLinkProps = {
|
||||
href: string;
|
||||
label: string;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
export function DetailBackLink({ href, label, className }: DetailBackLinkProps) {
|
||||
return (
|
||||
<Link
|
||||
href={href}
|
||||
aria-label={`Back to ${label}`}
|
||||
className={cn(
|
||||
"inline-flex items-center gap-1.5 text-sm text-muted-foreground transition-colors hover:text-foreground",
|
||||
className,
|
||||
)}
|
||||
>
|
||||
<ArrowLeft aria-hidden="true" />
|
||||
<span>{label}</span>
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user