import { Link } from 'react-router-dom'; import { Calculator, BarChart3, Clock, FileText } from 'lucide-react'; import type { ComponentType } from 'react'; import { PublicLayout, PublicHero } from '@/components/public/PublicLayout'; import { useToolsOnline, type ToolName } from '@/hooks/useToolUsage'; interface Tool { slug: ToolName; title: string; description: string; icon: ComponentType<{ className?: string }>; } const TOOLS: Tool[] = [ { slug: 'hourly-rate-calculator', title: 'Hourly Rate Calculator', description: 'Work backwards from your target take-home to find the hourly rate you actually need to charge.', icon: Calculator, }, { slug: 'case-profitability', title: 'Case Profitability Analyzer', description: 'Plug in hours, rates, and case expenses to see whether a matter is making you money.', icon: BarChart3, }, { slug: 'billable-hours-tracker', title: 'Billable Hours Tracker', description: 'A no-signup timer with manual entries and CSV export. Saved locally to your browser.', icon: Clock, }, { slug: 'document-templates', title: 'Document Templates', description: 'Fill in a few fields, download a clean text version of common law-firm documents.', icon: FileText, }, ]; export default function ToolsIndexPage() { const online = useToolsOnline(); return (
{TOOLS.map((tool) => { const count = online.data?.online[tool.slug] ?? 0; return (
{count} online

{tool.title}

{tool.description}

Open tool → ); })}
); }