Turns on the calendar extension (built Feb 2026, stripped in the 2026-03-02 production readiness deploy, never re-enabled): ICS feed settings, calendar workspace, subscribe button on the Viktiga datum page. Hardening before first real use: feed serve route now requires the creator to still be a company member (offboarding stops the feed); stable pagination (due_date + id, dedupe) on feed queries; fetches inside the logged try block; invoice events limited to sent/paid/partially_paid/overdue; event UIDs rebranded to accounted.se while zero feeds exist; APP_URL fallback fails closed in production; mobile stacking for the deadlines header; settings note that Google Calendar needs default notifications on subscribed calendars; calendar workspace aligned with the design system. Skeptic reviewed (3 refutations, all fixed) plus one compliance swarm finding (fixed). No migrations. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
24 lines
673 B
TypeScript
24 lines
673 B
TypeScript
'use client'
|
|
|
|
import { CalendarViewMode } from '@/types'
|
|
import { VIEW_MODE_LABELS } from '@/lib/calendar/utils'
|
|
import { SegmentedControl } from '@/components/ui/segmented-control'
|
|
|
|
interface ViewModeSelectorProps {
|
|
viewMode: CalendarViewMode
|
|
onViewModeChange: (mode: CalendarViewMode) => void
|
|
}
|
|
|
|
export function ViewModeSelector({ viewMode, onViewModeChange }: ViewModeSelectorProps) {
|
|
const modes: CalendarViewMode[] = ['month', 'week', 'day']
|
|
|
|
return (
|
|
<SegmentedControl
|
|
value={viewMode}
|
|
onChange={onViewModeChange}
|
|
options={modes.map((mode) => ({ value: mode, label: VIEW_MODE_LABELS[mode] }))}
|
|
aria-label="Kalendervy"
|
|
/>
|
|
)
|
|
}
|