27 lines
672 B
TypeScript
27 lines
672 B
TypeScript
import { Button } from "../button";
|
|
import { cn } from "~/lib/utils";
|
|
import { t as i18nT } from "i18next";
|
|
|
|
export default function BackButtonWithTitle({
|
|
href,
|
|
children,
|
|
className,
|
|
size = "xs",
|
|
}: {
|
|
href: string;
|
|
children: React.ReactNode;
|
|
className?: string;
|
|
size?: "default" | "sm" | "xs" | "sm" | "lg";
|
|
}) {
|
|
return (
|
|
<div className={cn("flex items-center space-x-2 truncate", className)}>
|
|
<Button size={size} variant="outline" asChild className="truncate font-normal">
|
|
<a href={href} aria-label={i18nT("shared.back")}>
|
|
←
|
|
</a>
|
|
</Button>
|
|
<div className="truncate">{children}</div>
|
|
</div>
|
|
);
|
|
}
|