import { Button } from "@/components/ui/button"; import { ChevronLeft } from "lucide-react"; import { useLocation } from "wouter"; interface BackButtonProps { to?: string; fallbackPath?: string; className?: string; } export function BackButton({ to, fallbackPath = "/", className = "" }: BackButtonProps) { const [_, setLocation] = useLocation(); const handleBack = () => { if (to) { setLocation(to); } else if (window.history.length > 2) { window.history.back(); } else { setLocation(fallbackPath); } }; return ( ); }