| 123456789101112131415161718192021222324 |
- import { Link } from '@inertiajs/react';
- import type { InertiaLinkProps } from '@inertiajs/react';
- import { ArrowLeft } from 'lucide-react';
- import { Button } from '@/components/ui/button';
-
- /**
- * The "← Back to …" button at the top of a page. Outlined, so it is easy to see.
- */
- export function BackButton({
- href,
- children,
- }: {
- href: InertiaLinkProps['href'];
- children: React.ReactNode;
- }) {
- return (
- <Button variant="outline" size="sm" className="-ml-0.5" asChild>
- <Link href={href} data-test="back-button">
- <ArrowLeft />
- {children}
- </Link>
- </Button>
- );
- }
|