import { Button } from '@/Components/ui/button';
import { Link } from '@inertiajs/react';
import { ArrowLeft } from 'lucide-react';

interface BackButtonProps {
    href: string;
    label?: string | null;
}

export default function BackButton({
    href,
    label = '',
    ...props
}: BackButtonProps) {
    return (
        <Link href={href}>
            <Button
                variant="outline"
                className="size-10 rounded-full border-0 bg-white shadow-md print:hidden"
                {...props}
            >
                <ArrowLeft />
            </Button>
            <span className="ml-4 text-zinc-500">{label}</span>
        </Link>
    );
}
