import type { ComponentType, ReactNode } from 'react'; import { Link } from 'react-router-dom'; import { cn } from '@/lib/utils'; /** * Shared empty-state component. * * Before this existed the app had ~39 ad-hoc empty states, each free to drift * in spacing, tone and — crucially — whether they offered a way *out*. The * `action` slot is the valuable part: "No crews nearby → Create one" turns a * dead-end into a loop. Prefer this component over hand-rolling new ones. */ export interface EmptyStateAction { /** Button label. */ label: string; /** Internal route to navigate to (renders a ). */ to?: string; /** Click handler (renders a ); } export function EmptyState({ icon: Icon, emoji, title, hint, actions, footer, className, }: EmptyStateProps) { return (
{(Icon || emoji) && (
{emoji ? ( ) : ( Icon && )}
)}

{title}

{hint && (

{hint}

)} {actions && actions.length > 0 && (
{actions.map((action) => ( ))}
)} {footer && ( {footer.label} )}
); } export default EmptyState;