import { CalendarRange } from "lucide-react"; import type { SeasonSegment } from "@/lib/autopilot/types"; export const SEGMENT_LABELS: Record = { WINTERRUHE: "Winterruhe", FRUEHJAHR: "Frühjahr", SCHWARMZEIT: "Schwarmzeit", SOMMER: "Sommer", SPAETSOMMER: "Spätsommer", HERBST: "Herbst", }; /** „Schwarmzeit · alle 7 Tage“; without an interval just the segment. */ export function seasonChipText(season: { segment: SeasonSegment; intervalDays: number | null; }): string { const label = SEGMENT_LABELS[season.segment]; if (season.intervalDays === null) return label; return season.intervalDays === 1 ? `${label} · täglich` : `${label} · alle ${season.intervalDays} Tage`; } interface SeasonChipProps { segment: SeasonSegment; intervalDays?: number | null; /** Names the apiary: „Obstwiese: Schwarmzeit“. */ apiaryName?: string; } /** The season of an apiary as icon plus words. */ export function SeasonChip({ segment, intervalDays = null, apiaryName }: SeasonChipProps) { const text = seasonChipText({ segment, intervalDays }); return ( {apiaryName ? `${apiaryName}: ${text}` : text} ); }