import { Clock, Lock, Tools } from 'iconoir-react'; import type { ComponentType } from 'react'; import { Link } from 'react-router'; type Reason = 'soon' | 'maintenance' | 'auth'; interface Action { to: string; label: string; className: string; } interface Content { Icon: ComponentType<{ className?: string }>; title: string; description: string; actions: Action[]; } const CONTENT: Record = { soon: { Icon: Clock, title: 'This feature is not available yet', description: 'This feature is still in development.', actions: [ { to: '/breweries', label: 'Browse breweries', className: 'btn-primary' }, { to: '/', label: 'Back to home', className: 'btn-ghost' }, ], }, maintenance: { Icon: Tools, title: 'This feature is temporarily unavailable', description: 'This feature is offline for maintenance. Try again in a few minutes.', actions: [], }, auth: { Icon: Lock, title: 'Sign in to use this feature', description: 'This feature requires a valid session. Log in or create an account to continue.', actions: [ { to: '/login', label: 'Login', className: 'btn-primary' }, { to: '/register', label: 'Register', className: 'btn-outline' }, ], }, }; interface FeatureNotAvailableProps { reason?: Reason; } const FeatureNotAvailable = ({ reason = 'soon' }: FeatureNotAvailableProps) => { const { Icon, title, description, actions } = CONTENT[reason]; return (

{title}

{description}

{actions.length > 0 && (
{actions.map(({ to, label, className }) => ( {label} ))}
)}
); }; export default FeatureNotAvailable;