Add OSHA Form 301 and Osha page components
CI / Lint, typecheck, test, build (push) Canceled after 0s
CI / End-to-end tests (push) Canceled after 0s

- Implemented Form301 component for displaying OSHA Form 301 equivalent, including employee and case information.
- Created Osha component to manage OSHA recordkeeping, including tabs for 300 Log, 300A Summary, Hours & rates, and Submit to OSHA.
- Added functionality for printing and downloading CSV files for OSHA submissions.
- Integrated loading and error handling states for data fetching.
This commit is contained in:
jayjennings committed 2026-10-06 13:09:57 -07:00
1 parent 3e964d1176
commit 61c876edec
59 files changed
+9180 -183

No files matched your search

+7 -1
View File
@@ -1,4 +1,5 @@
import { BarChart3, ClipboardCheck, ClipboardList, LayoutDashboard, MapPin, type LucideIcon } from 'lucide-react'
import { BarChart3, ClipboardCheck, ClipboardList, FileSpreadsheet, LayoutDashboard, MapPin, type LucideIcon } from 'lucide-react'
import type { Role } from '../../shared/enums.ts'
import type { Messages } from '../i18n/en'
@@ -6,6 +7,8 @@ export interface NavItem {
label: keyof Messages['nav']
to: string
icon: LucideIcon
/** Hidden from roles below this. */
minRole?: Role
}
export const primaryNav: NavItem[] = [
@@ -14,9 +17,11 @@ export const primaryNav: NavItem[] = [
{ label: 'myActions', to: '/actions', icon: ClipboardCheck },
{ label: 'locations', to: '/locations', icon: MapPin },
{ label: 'analytics', to: '/analytics', icon: BarChart3 },
{ label: 'osha', to: '/osha', icon: FileSpreadsheet, minRole: 'safety_manager' },
]
export function pageTitle(pathname: string): string {
if (/^\/osha\/cases\//.test(pathname)) return 'Form 301'
const incident = /^\/incidents\/(\d+)/.exec(pathname)
if (incident) return `INC-${incident[1].padStart(4, '0')}`
const titles: Record<string, string> = {
@@ -25,6 +30,7 @@ export function pageTitle(pathname: string): string {
'/actions': 'My actions',
'/locations': 'Locations',
'/analytics': 'Analytics',
'/osha': 'OSHA log',
'/report': 'Report an incident',
'/locations/qr': 'QR codes',
'/settings': 'Settings',