@burdenoff/microfe-healthybowl 2026.714.5 → 2026.714.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/wspace-operations.js +6 -7
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/healthybowl/HealthyBowlRoutes.js +111 -95
- package/dist/healthybowl/HealthyBowlRoutes.js.map +1 -1
- package/dist/healthybowl/hooks/useWeatherIntelligence.js +224 -0
- package/dist/healthybowl/hooks/useWeatherIntelligence.js.map +1 -0
- package/dist/healthybowl/pages/weather/FrostRiskCalendarPage.js +258 -0
- package/dist/healthybowl/pages/weather/FrostRiskCalendarPage.js.map +1 -0
- package/dist/healthybowl/pages/weather/WeatherAlertHistoryPage.js +255 -0
- package/dist/healthybowl/pages/weather/WeatherAlertHistoryPage.js.map +1 -0
- package/dist/healthybowl/pages/weather/WeatherAnomalyReportPage.js +387 -0
- package/dist/healthybowl/pages/weather/WeatherAnomalyReportPage.js.map +1 -0
- package/dist/healthybowl/pages/weather/WeatherHistoryPage.js +313 -114
- package/dist/healthybowl/pages/weather/WeatherHistoryPage.js.map +1 -1
- package/dist/healthybowl/pages/weather/WeatherOverviewPage.js +554 -213
- package/dist/healthybowl/pages/weather/WeatherOverviewPage.js.map +1 -1
- package/dist/healthybowl/pages/weather/WeatherSettingsPage.js +457 -0
- package/dist/healthybowl/pages/weather/WeatherSettingsPage.js.map +1 -0
- package/dist/node_modules/date-fns/addDays.js.map +1 -1
- package/dist/node_modules/date-fns/locale/ta/_lib/localize.js.map +1 -1
- package/dist/node_modules/date-fns/locale/zh-CN/_lib/match.js +15 -15
- package/dist/node_modules/date-fns/locale/zh-CN/_lib/match.js.map +1 -1
- package/dist/services/assistantApi.js +34 -234
- package/dist/services/assistantApi.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WeatherOverviewPage.js","names":[],"sources":["../../../../src/healthybowl/pages/weather/WeatherOverviewPage.tsx"],"sourcesContent":["import { useMemo, useCallback, useState, type FC } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {\n Cloud,\n CloudRain,\n Sun,\n CloudLightning,\n Wind,\n Droplets,\n Eye,\n Gauge,\n AlertTriangle,\n TrendingUp,\n Calendar,\n Bell,\n MapPin,\n ChevronRight,\n ArrowUp,\n ArrowDown,\n Loader2,\n} from 'lucide-react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { PageLayout, StatusBadge, ErrorState, PageLoader, Modal, WeatherMap, EmptyState } from '../../components';\nimport { ToastContainer } from '../../components/Toast';\nimport { useToast } from '../../hooks/useToast';\nimport { useHealthyBowlData } from '../../hooks/useHealthyBowlData';\nimport { useBasePath } from '../../hooks/useBasePath';\nimport { geocodePlace } from '../../utils/geocode';\n\nconst severityVariant = (s: string) =>\n s === 'extreme' || s === 'severe' ? ('error' as const) : s === 'moderate' ? ('warning' as const) : ('info' as const);\n\nconst severityBorder = (s: string) => {\n switch (s) {\n case 'extreme':\n return 'border-l-red-600';\n case 'severe':\n return 'border-l-red-500';\n case 'moderate':\n return 'border-l-amber-500';\n case 'minor':\n return 'border-l-sky-500';\n default:\n return 'border-l-border';\n }\n};\n\nconst getWeatherIcon = (condition: string) => {\n switch (condition.toLowerCase()) {\n case 'sunny':\n case 'clear':\n return Sun;\n case 'partly cloudy':\n return Cloud;\n case 'rain':\n return CloudRain;\n case 'thunderstorm':\n return CloudLightning;\n case 'cloudy':\n return Cloud;\n default:\n return Sun;\n }\n};\n\ntype UVLevel = 'low' | 'moderate' | 'high' | 'veryHigh' | 'extreme';\n\nconst getUVLevel = (uv: number): UVLevel => {\n if (uv <= 2) return 'low';\n if (uv <= 5) return 'moderate';\n if (uv <= 7) return 'high';\n if (uv <= 10) return 'veryHigh';\n return 'extreme';\n};\n\nexport const WeatherOverviewPage: FC = () => {\n const { weatherData, farm, createFarm, updateFarm, loadings, errors, refetch } = useHealthyBowlData();\n const [mapOpen, setMapOpen] = useState(false);\n const [locationOpen, setLocationOpen] = useState(false);\n const [locationInput, setLocationInput] = useState('');\n const [savingLocation, setSavingLocation] = useState(false);\n\n const navigate = useNavigate();\n // buildPath gives absolute MFE paths; bare navigate(buildPath('weather/forecast')) resolves\n // relative to /healthybowl/weather → /healthybowl/forecast (404).\n const { buildPath } = useBasePath();\n const { t: translate } = useI18n();\n const t = useCallback(\n (key: string, fallback: string, vars?: Record<string, string | number>): string => {\n const resolved = translate(key);\n const base = resolved === key ? fallback : resolved;\n if (!vars) return base;\n return Object.entries(vars).reduce(\n (str, [varKey, varValue]) => str.replace(`{{${varKey}}}`, String(varValue)),\n base\n );\n },\n [translate]\n );\n const { toasts, toast, dismiss } = useToast();\n const defaultCurrent = {\n temperature: 0,\n condition: 'N/A',\n feelsLike: 0,\n humidity: 0,\n windSpeed: 0,\n windDirection: '',\n uvIndex: 0,\n pressure: 0,\n visibility: 0,\n icon: '',\n };\n const current = weatherData?.current ?? defaultCurrent;\n const forecast = weatherData?.forecast ?? [];\n const alerts = weatherData?.alerts ?? [];\n const location = weatherData?.location ?? '';\n const weatherMapCenter =\n typeof weatherData?.latitude === 'number' && typeof weatherData?.longitude === 'number'\n ? { lat: weatherData.latitude, lng: weatherData.longitude }\n : null;\n\n // No resolved location AND no forecast points => the svc has nowhere to fetch\n // weather for. Render an honest empty-state with a CTA rather than the\n // all-zeros default that looks like real (but fake) data.\n const needsLocation = location === '' && forecast.length === 0;\n const todayForecast =\n forecast[0] ??\n ({\n high: current.temperature,\n low: current.temperature,\n precipitation: 0,\n humidity: current.humidity,\n windSpeed: current.windSpeed,\n } as const);\n\n const uvLabel = useCallback(\n (uv: number): string => {\n const level = getUVLevel(uv);\n const labels: Record<UVLevel, string> = {\n low: t('healthybowl.weather.overview.uv.low', 'Low'),\n moderate: t('healthybowl.weather.overview.uv.moderate', 'Moderate'),\n high: t('healthybowl.weather.overview.uv.high', 'High'),\n veryHigh: t('healthybowl.weather.overview.uv.veryHigh', 'Very High'),\n extreme: t('healthybowl.weather.overview.uv.extreme', 'Extreme'),\n };\n return labels[level];\n },\n [t]\n );\n\n const openLocationModal = useCallback(() => {\n setLocationInput(farm.location ?? '');\n setLocationOpen(true);\n }, [farm.location]);\n\n // Set the farm's weather location: geocode the free-text place client-side\n // (Open-Meteo, keyless), then persist via updateFarm (or createFarm when no\n // farm exists yet) with the resolved lat/lng so the svc can fetch weather for\n // the new place, and refetch the weather query.\n const handleSaveLocation = useCallback(async () => {\n const place = locationInput.trim();\n if (!place) {\n toast({\n title: t('healthybowl.weather.overview.location.toast.required.title', 'Location required'),\n description: t(\n 'healthybowl.weather.overview.location.toast.required.description',\n 'Enter a town, city, or region to set your farm location.'\n ),\n variant: 'warning',\n });\n return;\n }\n setSavingLocation(true);\n try {\n const hit = await geocodePlace(place);\n const coords = hit ? { latitude: hit.latitude, longitude: hit.longitude } : {};\n if (farm.id) {\n await updateFarm({ id: farm.id, location: place, ...coords });\n } else {\n // Minimal farm bootstrap so weather has a home; the profile page fills the rest.\n await createFarm({\n name: t('healthybowl.weather.overview.location.defaultFarmName', 'My Farm'),\n location: place,\n owner: '',\n totalArea: 0,\n areaUnit: 'acres',\n organicCertified: false,\n ...coords,\n });\n }\n toast({\n title: t('healthybowl.weather.overview.location.toast.saved.title', 'Location set'),\n description: hit\n ? t('healthybowl.weather.overview.location.toast.saved.resolved', 'Weather will load for {{place}}.', {\n place: [hit.name, hit.admin1, hit.country].filter(Boolean).join(', ') || place,\n })\n : t(\n 'healthybowl.weather.overview.location.toast.saved.unresolved',\n 'Saved \"{{place}}\". We could not resolve exact coordinates — the server will try to geocode it.',\n { place }\n ),\n variant: 'success',\n });\n setLocationOpen(false);\n await refetch();\n } catch (err) {\n toast({\n title: t('healthybowl.weather.overview.location.toast.failed.title', 'Could not set location'),\n description: err instanceof Error ? err.message : String(err),\n variant: 'error',\n });\n } finally {\n setSavingLocation(false);\n }\n }, [locationInput, farm.id, updateFarm, createFarm, refetch, toast, t]);\n\n // Derive farming recommendations from actual weather conditions\n const farmingRecommendations = useMemo(() => {\n const recs: { id: string; title: string; description: string; icon: typeof TrendingUp; iconColor: string }[] = [];\n if (current.humidity >= 40 && current.humidity <= 70 && current.temperature >= 15 && current.temperature <= 30) {\n recs.push({\n id: 'goodIrrigation',\n title: t('healthybowl.weather.overview.recommendations.goodIrrigation.title', 'Good conditions for irrigation'),\n description: t(\n 'healthybowl.weather.overview.recommendations.goodIrrigation.description',\n 'Humidity at {{humidity}}% and {{temperature}}°C are optimal for watering crops',\n { humidity: current.humidity, temperature: current.temperature }\n ),\n icon: TrendingUp,\n iconColor: 'text-success',\n });\n } else if (current.humidity > 70) {\n recs.push({\n id: 'skipIrrigation',\n title: t('healthybowl.weather.overview.recommendations.skipIrrigation.title', 'Skip irrigation today'),\n description: t(\n 'healthybowl.weather.overview.recommendations.skipIrrigation.description',\n 'Humidity is high at {{humidity}}% — soil moisture is likely adequate',\n { humidity: current.humidity }\n ),\n icon: Droplets,\n iconColor: 'text-info',\n });\n } else {\n recs.push({\n id: 'increaseIrrigation',\n title: t('healthybowl.weather.overview.recommendations.increaseIrrigation.title', 'Increase irrigation'),\n description: t(\n 'healthybowl.weather.overview.recommendations.increaseIrrigation.description',\n 'Low humidity at {{humidity}}% — crops may need extra watering',\n { humidity: current.humidity }\n ),\n icon: AlertTriangle,\n iconColor: 'text-warning',\n });\n }\n const rainForecast = forecast.find((d) => d.precipitation > 50);\n if (rainForecast) {\n recs.push({\n id: 'heavyRain',\n title: t('healthybowl.weather.overview.recommendations.heavyRain.title', 'Prepare for heavy rain'),\n description: t(\n 'healthybowl.weather.overview.recommendations.heavyRain.description',\n '{{precipitation}}% precipitation expected on {{day}} — ensure proper drainage',\n {\n precipitation: rainForecast.precipitation,\n day: new Date(rainForecast.date).toLocaleDateString('en-US', { weekday: 'short' }),\n }\n ),\n icon: AlertTriangle,\n iconColor: 'text-warning',\n });\n }\n if (current.windSpeed > 20) {\n recs.push({\n id: 'windSensitive',\n title: t('healthybowl.weather.overview.recommendations.windSensitive.title', 'Monitor wind-sensitive crops'),\n description: t(\n 'healthybowl.weather.overview.recommendations.windSensitive.description',\n 'Wind at {{windSpeed}} km/h {{windDirection}} — check support structures for tall crops',\n { windSpeed: current.windSpeed, windDirection: current.windDirection }\n ),\n icon: Wind,\n iconColor: 'text-info',\n });\n }\n if (current.uvIndex >= 8) {\n recs.push({\n id: 'highUV',\n title: t('healthybowl.weather.overview.recommendations.highUV.title', 'High UV exposure'),\n description: t(\n 'healthybowl.weather.overview.recommendations.highUV.description',\n 'UV index at {{uvIndex}} ({{uvLabel}}) — consider shade protection for sensitive crops',\n { uvIndex: current.uvIndex, uvLabel: uvLabel(current.uvIndex) }\n ),\n icon: AlertTriangle,\n iconColor: 'text-status-error-text',\n });\n }\n if (recs.length === 0) {\n recs.push({\n id: 'stable',\n title: t('healthybowl.weather.overview.recommendations.stable.title', 'Conditions are stable'),\n description: t(\n 'healthybowl.weather.overview.recommendations.stable.description',\n 'No immediate weather concerns for farming operations'\n ),\n icon: TrendingUp,\n iconColor: 'text-success',\n });\n }\n return recs;\n }, [current, forecast, t, uvLabel]);\n\n // Derive weather impact metrics from forecast/alert data\n const weatherImpactMetrics = useMemo(() => {\n const levelLow = t('healthybowl.weather.overview.impact.levels.low', 'Low');\n const levelModerate = t('healthybowl.weather.overview.impact.levels.moderate', 'Moderate');\n const levelHigh = t('healthybowl.weather.overview.impact.levels.high', 'High');\n\n const tempScore =\n current.temperature >= 15 && current.temperature <= 30\n ? 90\n : current.temperature >= 10 && current.temperature <= 35\n ? 60\n : 30;\n const humidityScore = current.humidity >= 40 && current.humidity <= 70 ? 85 : 50;\n const growthPercent = Math.round((tempScore + humidityScore) / 2);\n const growthLevel =\n growthPercent >= 80\n ? t('healthybowl.weather.overview.impact.levels.excellent', 'Excellent')\n : growthPercent >= 60\n ? t('healthybowl.weather.overview.impact.levels.good', 'Good')\n : growthPercent >= 40\n ? levelModerate\n : t('healthybowl.weather.overview.impact.levels.poor', 'Poor');\n const growthColor = growthPercent >= 60 ? 'bg-success' : growthPercent >= 40 ? 'bg-warning' : 'bg-status-error-bg';\n\n const severeAlerts = alerts.filter((a) => a.severity === 'extreme' || a.severity === 'severe').length;\n const diseasePercent = Math.min(100, Math.round((current.humidity / 100) * 60 + severeAlerts * 15));\n const diseaseLevel = diseasePercent >= 70 ? levelHigh : diseasePercent >= 40 ? levelModerate : levelLow;\n const diseaseColor =\n diseasePercent >= 70 ? 'bg-status-error-bg' : diseasePercent >= 40 ? 'bg-warning' : 'bg-success';\n\n const windFactor = Math.min(100, Math.round((current.windSpeed / 50) * 100));\n const pestPercent = Math.min(100, Math.round(windFactor * 0.4 + (current.temperature > 25 ? 30 : 10)));\n const pestLevel = pestPercent >= 60 ? levelHigh : pestPercent >= 30 ? levelModerate : levelLow;\n const pestColor = pestPercent >= 60 ? 'bg-status-error-bg' : pestPercent >= 30 ? 'bg-warning' : 'bg-success';\n\n const avgPrecip = forecast.length > 0 ? forecast.reduce((s, d) => s + d.precipitation, 0) / forecast.length : 0;\n const irrigationPercent = Math.max(0, Math.min(100, Math.round(100 - avgPrecip - current.humidity * 0.5)));\n const irrigationLevel = irrigationPercent >= 60 ? levelHigh : irrigationPercent >= 30 ? levelModerate : levelLow;\n const irrigationColor =\n irrigationPercent >= 60 ? 'bg-status-error-bg' : irrigationPercent >= 30 ? 'bg-warning' : 'bg-info';\n\n return [\n {\n id: 'cropGrowth',\n label: t('healthybowl.weather.overview.impact.cropGrowth.label', 'Crop Growth Conditions'),\n level: growthLevel,\n percent: growthPercent,\n color: growthColor,\n },\n {\n id: 'diseaseRisk',\n label: t('healthybowl.weather.overview.impact.diseaseRisk.label', 'Disease Risk'),\n level: diseaseLevel,\n percent: diseasePercent,\n color: diseaseColor,\n },\n {\n id: 'pestActivity',\n label: t('healthybowl.weather.overview.impact.pestActivity.label', 'Pest Activity'),\n level: pestLevel,\n percent: pestPercent,\n color: pestColor,\n },\n {\n id: 'irrigationNeed',\n label: t('healthybowl.weather.overview.impact.irrigationNeed.label', 'Irrigation Need'),\n level: irrigationLevel,\n percent: irrigationPercent,\n color: irrigationColor,\n },\n ];\n }, [current, forecast, alerts, t]);\n\n return (\n <PageLayout\n title={t('healthybowl.weather.overview.title', 'Weather Dashboard')}\n description={t(\n 'healthybowl.weather.overview.description',\n 'Real-time weather data and forecasts for {{location}}',\n {\n location,\n }\n )}\n purpose=\"Today's conditions and the days ahead for your farm in one view. Check the weather before you head out, and jump into the full forecast, history or alerts when you need to plan or react.\"\n nextStepsKey=\"healthybowl-weather-overview\"\n nextStepsTitle=\"Plan around the weather\"\n nextSteps={[\n {\n id: 'forecast',\n label: 'See the full forecast',\n description: 'Plan field work around the 7-day outlook.',\n onClick: () => navigate(buildPath('weather/forecast')),\n },\n {\n id: 'alerts',\n label: 'Set up weather alerts',\n description: 'Get warned about frost, heat or heavy rain in time to act.',\n onClick: () => navigate(buildPath('weather/alerts')),\n },\n {\n id: 'history',\n label: 'Review weather history',\n description: 'Compare past seasons to plan planting and irrigation.',\n onClick: () => navigate(buildPath('weather/history')),\n },\n ]}\n actions={\n !needsLocation && !loadings.weather && !errors.weather ? (\n <Button variant=\"outline\" size=\"sm\" onClick={openLocationModal}>\n <MapPin className=\"h-4 w-4 text-text-secondary\" />\n {t('healthybowl.weather.overview.actions.changeLocation', 'Change location')}\n </Button>\n ) : undefined\n }\n >\n {loadings.weather ? (\n <PageLoader />\n ) : errors.weather ? (\n <ErrorState onRetry={refetch} />\n ) : needsLocation ? (\n <EmptyState\n illustration=\"empty-generic\"\n title={t('healthybowl.weather.overview.emptyState.title', 'No farm location set')}\n description={t(\n 'healthybowl.weather.overview.emptyState.description',\n 'Weather forecasts need a location. Set your farm location to see real-time conditions, a 7-day forecast, and farming recommendations.'\n )}\n action={\n <Button onClick={openLocationModal}>\n <MapPin className=\"h-4 w-4\" />\n {t('healthybowl.weather.overview.emptyState.action', 'Set your farm location')}\n </Button>\n }\n />\n ) : (\n <>\n {/* Quick Navigation */}\n <div className=\"grid grid-cols-2 gap-3 md:grid-cols-4\">\n <Button variant=\"outline\" onClick={() => navigate(buildPath('weather/forecast'))}>\n <Calendar className=\"h-4 w-4 text-text-secondary\" />\n {t('healthybowl.weather.overview.quickNav.extendedForecast', 'Extended Forecast')}\n </Button>\n <Button variant=\"outline\" onClick={() => navigate(buildPath('weather/alerts'))}>\n <Bell className=\"h-4 w-4 text-text-secondary\" />\n {t('healthybowl.weather.overview.quickNav.alertSettings', 'Alert Settings')}\n </Button>\n <Button variant=\"outline\" onClick={() => navigate(buildPath('weather/history'))}>\n <TrendingUp className=\"h-4 w-4 text-text-secondary\" />\n {t('healthybowl.weather.overview.quickNav.historicalData', 'Historical Data')}\n </Button>\n <Button variant=\"outline\" onClick={() => setMapOpen(true)}>\n <MapPin className=\"h-4 w-4 text-text-secondary\" />{' '}\n {t('healthybowl.weather.overview.quickNav.weatherMaps', 'Weather Maps')}\n </Button>\n </div>\n\n {/* Weather Alerts */}\n {alerts.length > 0 && (\n <div className=\"space-y-3\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-base font-semibold text-text-primary\">\n {t('healthybowl.weather.overview.alerts.heading', 'Weather Alerts')}\n </h2>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => navigate(buildPath('weather/alerts'))}\n className=\"gap-1 text-text-secondary hover:text-text-primary\"\n >\n {t('healthybowl.weather.overview.alerts.manage', 'Manage Alerts')}{' '}\n <ChevronRight className=\"h-3.5 w-3.5\" />\n </Button>\n </div>\n {alerts.map((alert) => (\n <div\n key={alert.id}\n className={`rounded-lg border border-border-subtle border-l-4 bg-bg-surface p-4 ${severityBorder(alert.severity)}`}\n >\n <div className=\"flex items-start gap-3\">\n <AlertTriangle className=\"mt-0.5 h-5 w-5 shrink-0 text-warning\" />\n <div className=\"flex-1\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <h3 className=\"text-sm font-medium text-text-primary\">{alert.title}</h3>\n <StatusBadge label={alert.severity} variant={severityVariant(alert.severity)} />\n </div>\n <p className=\"mt-1 text-sm text-text-secondary\">{alert.description}</p>\n <p className=\"mt-1 text-xs text-text-secondary\">\n {t('healthybowl.weather.overview.alerts.affected', 'Affected: {{areas}}', {\n areas: (alert.affectedAreas ?? []).join(', '),\n })}\n </p>\n </div>\n </div>\n </div>\n ))}\n </div>\n )}\n\n {/* Current Weather + Today's Summary */}\n <div className=\"grid grid-cols-1 gap-4 lg:grid-cols-3\">\n {/* Main Current Weather Card */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6 lg:col-span-2\">\n <div className=\"mb-4 flex items-center gap-2\">\n {(() => {\n const Icon = getWeatherIcon(current.condition);\n return <Icon className=\"h-8 w-8 text-text-secondary\" />;\n })()}\n <div>\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t('healthybowl.weather.overview.current.title', 'Current Weather')}\n </h3>\n <p className=\"text-xs text-text-secondary\">\n {t('healthybowl.weather.overview.current.lastUpdated', 'Last updated: {{time}}', {\n time: new Date().toLocaleString(),\n })}\n </p>\n </div>\n </div>\n <div className=\"grid grid-cols-2 gap-6 md:grid-cols-4\">\n {/* Temp */}\n <div className=\"text-center\">\n <div className=\"text-3xl font-bold text-text-primary\">{current.temperature}°C</div>\n <div className=\"text-sm text-text-secondary\">\n {t('healthybowl.weather.overview.current.feelsLike', 'Feels like {{temp}}°C', {\n temp: current.feelsLike,\n })}\n </div>\n <div className=\"mt-1 text-sm font-medium text-text-primary\">{current.condition}</div>\n </div>\n {/* Humidity & Wind */}\n <div className=\"space-y-2\">\n <div className=\"flex items-center gap-2\">\n <Droplets className=\"h-4 w-4 text-info\" />\n <span className=\"text-sm text-text-primary\">\n {t('healthybowl.weather.overview.current.humidity', 'Humidity: {{value}}%', {\n value: current.humidity,\n })}\n </span>\n </div>\n <div className=\"flex items-center gap-2\">\n <Wind className=\"h-4 w-4 text-text-secondary\" />\n <span className=\"text-sm text-text-primary\">\n {t('healthybowl.weather.overview.current.wind', 'Wind: {{speed}} km/h {{direction}}', {\n speed: current.windSpeed,\n direction: current.windDirection,\n })}\n </span>\n </div>\n </div>\n {/* Pressure & Visibility */}\n <div className=\"space-y-2\">\n <div className=\"flex items-center gap-2\">\n <Gauge className=\"h-4 w-4 text-primary\" />\n <span className=\"text-sm text-text-primary\">\n {t('healthybowl.weather.overview.current.pressure', 'Pressure: {{value}} hPa', {\n value: current.pressure,\n })}\n </span>\n </div>\n <div className=\"flex items-center gap-2\">\n <Eye className=\"h-4 w-4 text-success\" />\n <span className=\"text-sm text-text-primary\">\n {t('healthybowl.weather.overview.current.visibility', 'Visibility: {{value}} km', {\n value: current.visibility,\n })}\n </span>\n </div>\n </div>\n {/* UV Index */}\n <div className=\"space-y-2\">\n <div className=\"text-sm\">\n <span className=\"text-text-secondary\">\n {t('healthybowl.weather.overview.current.uvIndex', 'UV Index: ')}\n </span>\n <span className=\"font-medium text-text-primary\">\n {current.uvIndex} ({uvLabel(current.uvIndex)})\n </span>\n </div>\n </div>\n </div>\n </div>\n\n {/* Today's Summary */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t('healthybowl.weather.overview.summary.title', \"Today's Summary\")}\n </h3>\n <div className=\"mt-4 space-y-4\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {t('healthybowl.weather.overview.summary.high', 'High')}\n </span>\n <div className=\"flex items-center gap-1\">\n <ArrowUp className=\"h-3.5 w-3.5 text-status-error-text\" />\n <span className=\"font-medium text-text-primary\">{todayForecast.high}°C</span>\n </div>\n </div>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {t('healthybowl.weather.overview.summary.low', 'Low')}\n </span>\n <div className=\"flex items-center gap-1\">\n <ArrowDown className=\"h-3.5 w-3.5 text-info\" />\n <span className=\"font-medium text-text-primary\">{todayForecast.low}°C</span>\n </div>\n </div>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {t('healthybowl.weather.overview.summary.precipitation', 'Precipitation')}\n </span>\n <span className=\"font-medium text-text-primary\">{todayForecast.precipitation}%</span>\n </div>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {t('healthybowl.weather.overview.summary.humidity', 'Humidity')}\n </span>\n <span className=\"font-medium text-text-primary\">{todayForecast.humidity}%</span>\n </div>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {t('healthybowl.weather.overview.summary.windSpeed', 'Wind Speed')}\n </span>\n <span className=\"font-medium text-text-primary\">{todayForecast.windSpeed} km/h</span>\n </div>\n </div>\n </div>\n </div>\n\n {/* 7-Day Forecast */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <div className=\"mb-4 flex items-center justify-between\">\n <div>\n <h3 className=\"text-base font-semibold text-text-primary\">\n {t('healthybowl.weather.overview.forecast.title', '7-Day Forecast')}\n </h3>\n <p className=\"text-xs text-text-secondary\">\n {t('healthybowl.weather.overview.forecast.subtitle', 'Click on any day for detailed forecast')}\n </p>\n </div>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => navigate(buildPath('weather/forecast'))}\n className=\"gap-1 text-text-secondary hover:text-text-primary\"\n >\n {t('healthybowl.weather.overview.forecast.viewExtended', 'View Extended Forecast')}{' '}\n <ChevronRight className=\"h-3.5 w-3.5\" />\n </Button>\n </div>\n <div className=\"space-y-2\">\n {forecast.slice(0, 7).map((day, index) => {\n const Icon = getWeatherIcon(day.condition);\n return (\n <div\n key={day.date}\n onClick={() => navigate(buildPath('weather/forecast'))}\n className=\"flex cursor-pointer items-center justify-between rounded-lg px-3 py-2.5 transition-colors hover:bg-bg-sunken/50\"\n >\n <div className=\"flex items-center gap-3 flex-1\">\n <span className=\"w-14 text-sm font-medium text-text-primary\">\n {index === 0\n ? t('healthybowl.weather.overview.forecast.today', 'Today')\n : new Date(day.date).toLocaleDateString('en-US', { weekday: 'short' })}\n </span>\n <Icon className=\"h-5 w-5 text-text-secondary\" />\n <span className=\"text-sm text-text-primary\">{day.condition}</span>\n </div>\n <div className=\"flex items-center gap-4 text-sm\">\n <div className=\"flex items-center gap-1\">\n <Droplets className=\"h-3 w-3 text-info\" />\n <span className=\"text-text-primary\">{day.precipitation}%</span>\n </div>\n <div className=\"flex items-center gap-2\">\n <span className=\"font-medium text-text-primary\">{day.high}°</span>\n <span className=\"text-text-secondary\">{day.low}°</span>\n </div>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n\n {/* Farming Recommendations + Weather Impact */}\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-2\">\n {/* Farming Recommendations - derived from current weather data */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <h3 className=\"text-base font-semibold text-text-primary\">\n {t('healthybowl.weather.overview.recommendations.title', 'Farming Recommendations')}\n </h3>\n <p className=\"text-xs text-text-secondary\">\n {t(\n 'healthybowl.weather.overview.recommendations.subtitle',\n 'AI-powered insights based on current conditions'\n )}\n </p>\n <div className=\"mt-4 space-y-3\">\n {farmingRecommendations.map((rec) => {\n const Icon = rec.icon;\n return (\n <div key={rec.id} className=\"flex items-start gap-3 rounded-lg bg-bg-sunken/50 p-3\">\n <Icon className={`mt-0.5 h-5 w-5 shrink-0 ${rec.iconColor}`} />\n <div>\n <p className=\"text-sm font-medium text-text-primary\">{rec.title}</p>\n <p className=\"text-xs text-text-secondary\">{rec.description}</p>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n\n {/* Weather Impact Analysis - derived from forecast/alert data */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <h3 className=\"text-base font-semibold text-text-primary\">\n {t('healthybowl.weather.overview.impact.title', 'Weather Impact Analysis')}\n </h3>\n <p className=\"text-xs text-text-secondary\">\n {t('healthybowl.weather.overview.impact.subtitle', 'Impact on farming operations')}\n </p>\n <div className=\"mt-4 space-y-4\">\n {weatherImpactMetrics.map(({ id, label, level, percent, color }) => (\n <div key={id}>\n <div className=\"mb-1.5 flex items-center justify-between\">\n <span className=\"text-sm font-medium text-text-primary\">{label}</span>\n <span className=\"text-sm font-medium text-text-secondary\">{level}</span>\n </div>\n <div className=\"h-2 w-full rounded-full bg-bg-sunken\">\n <div className={`h-2 rounded-full transition-all ${color}`} style={{ width: `${percent}%` }} />\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n </>\n )}\n\n <Modal\n open={mapOpen}\n onClose={() => setMapOpen(false)}\n title={t('healthybowl.weather.overview.map.title', 'Weather Map')}\n description={\n location\n ? t('healthybowl.weather.overview.map.descriptionNear', 'Live precipitation radar near {{location}}', {\n location,\n })\n : t('healthybowl.weather.overview.map.description', 'Live precipitation radar')\n }\n size=\"xl\"\n >\n {mapOpen && <WeatherMap location={location} center={weatherMapCenter} />}\n </Modal>\n\n {/* Set / change farm weather location */}\n <Modal\n open={locationOpen}\n onClose={() => setLocationOpen(false)}\n title={t('healthybowl.weather.overview.location.modal.title', 'Set farm location')}\n description={t(\n 'healthybowl.weather.overview.location.modal.description',\n 'Enter your farm’s town, city, or region. We use it to fetch local weather and forecasts.'\n )}\n size=\"md\"\n footer={\n <>\n <Button variant=\"outline\" onClick={() => setLocationOpen(false)}>\n {t('healthybowl.common.cancel', 'Cancel')}\n </Button>\n <Button onClick={handleSaveLocation} disabled={savingLocation}>\n {savingLocation && <Loader2 className=\"h-4 w-4 animate-spin\" />}\n {savingLocation\n ? t('healthybowl.weather.overview.location.modal.saving', 'Saving…')\n : t('healthybowl.weather.overview.location.modal.save', 'Save location')}\n </Button>\n </>\n }\n >\n <div>\n <label htmlFor=\"weather-location\" className=\"mb-1 block text-sm font-medium text-text-primary\">\n {t('healthybowl.weather.overview.location.field.label', 'Farm location')}\n </label>\n <input\n id=\"weather-location\"\n type=\"text\"\n value={locationInput}\n onChange={(e) => setLocationInput(e.target.value)}\n placeholder={t('healthybowl.weather.overview.location.field.placeholder', 'e.g., Pune, Maharashtra')}\n className=\"h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n <p className=\"mt-1 text-xs text-text-secondary\">\n {t(\n 'healthybowl.weather.overview.location.field.helper',\n 'We resolve coordinates automatically so the forecast reflects this exact place.'\n )}\n </p>\n </div>\n </Modal>\n\n <ToastContainer toasts={toasts} onDismiss={dismiss} />\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA8BA,IAAM,MAAmB,MACvB,MAAM,aAAa,MAAM,WAAY,UAAoB,MAAM,aAAc,YAAuB,QAEhG,MAAkB,MAAc;AACpC,SAAQ,GAAR;EACE,KAAK,UACH,QAAO;EACT,KAAK,SACH,QAAO;EACT,KAAK,WACH,QAAO;EACT,KAAK,QACH,QAAO;EACT,QACE,QAAO;;GAIP,KAAkB,MAAsB;AAC5C,SAAQ,EAAU,aAAa,EAA/B;EACE,KAAK;EACL,KAAK,QACH,QAAO;EACT,KAAK,gBACH,QAAO;EACT,KAAK,OACH,QAAO;EACT,KAAK,eACH,QAAO;EACT,KAAK,SACH,QAAO;EACT,QACE,QAAO;;GAMP,MAAc,MACd,KAAM,IAAU,QAChB,KAAM,IAAU,aAChB,KAAM,IAAU,SAChB,KAAM,KAAW,aACd,WAGI,UAAgC;CAC3C,IAAM,EAAE,gBAAa,SAAM,eAAY,eAAY,aAAU,WAAQ,eAAY,IAAoB,EAC/F,CAAC,GAAS,KAAc,EAAS,GAAM,EACvC,CAAC,IAAc,KAAmB,EAAS,GAAM,EACjD,CAAC,GAAe,KAAoB,EAAS,GAAG,EAChD,CAAC,GAAgB,KAAqB,EAAS,GAAM,EAErD,IAAW,IAAa,EAGxB,EAAE,iBAAc,GAAa,EAC7B,EAAE,GAAG,MAAc,GAAS,EAC5B,IAAI,GACP,GAAa,GAAkB,MAAmD;EACjF,IAAM,IAAW,EAAU,EAAI,EACzB,IAAO,MAAa,IAAM,I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AA;KACF,kBAAC,KAAD;MAAG,WAAU;gBACV,EACC,sDACA,kFACD;MACC,CAAA;KACA,EAAA,CAAA;IACA,CAAA;GAER,kBAAC,IAAD;IAAwB;IAAQ,WAAW;IAAW,CAAA;GAC3C"}
|
|
1
|
+
{"version":3,"file":"WeatherOverviewPage.js","names":[],"sources":["../../../../src/healthybowl/pages/weather/WeatherOverviewPage.tsx"],"sourcesContent":["import { useMemo, useCallback, useState, type FC } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { AreaChart, Area, ResponsiveContainer } from 'recharts';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {\n Cloud,\n CloudRain,\n Sun,\n CloudLightning,\n Wind,\n Droplets,\n Eye,\n Gauge,\n AlertTriangle,\n TrendingUp,\n Calendar,\n Bell,\n MapPin,\n ChevronRight,\n ArrowUp,\n ArrowDown,\n Loader2,\n Snowflake,\n Thermometer,\n Activity,\n CalendarDays,\n Workflow,\n History,\n Settings2,\n BarChart3,\n} from 'lucide-react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport {\n PageLayout,\n StatCard,\n StatusBadge,\n ErrorState,\n PageLoader,\n Modal,\n WeatherMap,\n EmptyState,\n} from '../../components';\nimport { ToastContainer } from '../../components/Toast';\nimport { useToast } from '../../hooks/useToast';\nimport { useHealthyBowlData } from '../../hooks/useHealthyBowlData';\nimport { useWeatherIntelligence } from '../../hooks/useWeatherIntelligence';\nimport { useDiseaseWarning } from '../../hooks/useDiseaseWarning';\nimport { useBasePath } from '../../hooks/useBasePath';\nimport { geocodePlace } from '../../utils/geocode';\n\nconst severityVariant = (s: string) =>\n s === 'extreme' || s === 'severe' ? ('error' as const) : s === 'moderate' ? ('warning' as const) : ('info' as const);\n\nconst severityBorder = (s: string) => {\n switch (s) {\n case 'extreme':\n return 'border-l-red-600';\n case 'severe':\n return 'border-l-red-500';\n case 'moderate':\n return 'border-l-amber-500';\n case 'minor':\n return 'border-l-sky-500';\n default:\n return 'border-l-border';\n }\n};\n\nconst getWeatherIcon = (condition: string) => {\n switch (condition.toLowerCase()) {\n case 'sunny':\n case 'clear':\n return Sun;\n case 'partly cloudy':\n return Cloud;\n case 'rain':\n return CloudRain;\n case 'thunderstorm':\n return CloudLightning;\n case 'cloudy':\n return Cloud;\n default:\n return Sun;\n }\n};\n\n// Severity band (RED | AMBER | GREY) → banner styling for weather-alert events.\nconst eventBannerClasses = (severity: string): string => {\n switch (severity) {\n case 'RED':\n return 'bg-red-600 text-white';\n case 'AMBER':\n return 'bg-amber-500 text-white';\n default:\n return 'bg-slate-500 text-white';\n }\n};\n\n// Map the live forecast alert severity onto the same RED/AMBER/GREY banner bands.\nconst forecastAlertBannerClasses = (severity: string): string => {\n switch (severity) {\n case 'extreme':\n case 'severe':\n return 'bg-red-600 text-white';\n case 'moderate':\n return 'bg-amber-500 text-white';\n default:\n return 'bg-slate-500 text-white';\n }\n};\n\n// Alert category → icon for the top banners.\nconst alertTypeIcon = (alertType: string) => {\n switch (alertType.toUpperCase()) {\n case 'FROST':\n return Snowflake;\n case 'STORM':\n return CloudLightning;\n case 'HEAT':\n return Thermometer;\n case 'DISEASE':\n return Activity;\n default:\n return AlertTriangle;\n }\n};\n\n// Infer a weather-category icon from free-text (forecast alerts aren't categorised).\nconst inferAlertIcon = (text: string) => {\n const s = text.toLowerCase();\n if (s.includes('frost') || s.includes('freeze') || s.includes('cold')) return Snowflake;\n if (s.includes('storm') || s.includes('thunder') || s.includes('rain') || s.includes('wind')) return CloudLightning;\n if (s.includes('heat') || s.includes('hot')) return Thermometer;\n return AlertTriangle;\n};\n\n// Frost-risk day band → mini-calendar cell colour (data-viz palette exception).\nconst frostRiskCellClasses = (risk: string): string => {\n switch (risk) {\n case 'FROST_HIGH':\n return 'bg-red-600 text-white';\n case 'FROST_WATCH':\n return 'bg-amber-500 text-white';\n case 'HEAT':\n return 'bg-orange-500 text-white';\n case 'STORM':\n return 'bg-slate-500 text-white';\n case 'DISEASE_WINDOW':\n return 'bg-violet-600 text-white';\n case 'CLEAR':\n return 'bg-emerald-600/15 text-emerald-700';\n default:\n return 'bg-bg-sunken text-text-secondary';\n }\n};\n\n// Format an ISO date as a short \"Nov 18\" style label; returns null for empty/invalid.\nconst formatShortDate = (iso?: string | null): string | null => {\n if (!iso) return null;\n const d = new Date(iso);\n if (Number.isNaN(d.getTime())) return null;\n return d.toLocaleDateString('en-US', { month: 'short', day: 'numeric' });\n};\n\ntype UVLevel = 'low' | 'moderate' | 'high' | 'veryHigh' | 'extreme';\n\nconst getUVLevel = (uv: number): UVLevel => {\n if (uv <= 2) return 'low';\n if (uv <= 5) return 'moderate';\n if (uv <= 7) return 'high';\n if (uv <= 10) return 'veryHigh';\n return 'extreme';\n};\n\nexport const WeatherOverviewPage: FC = () => {\n const { weatherData, farm, createFarm, updateFarm, loadings, errors, refetch } = useHealthyBowlData();\n // Weather-intelligence data (workspace-scoped, independent of farm location):\n // anomaly report, current-month frost-risk calendar, fired alert events + the\n // history series that feeds the \"wettest month\" stat.\n const {\n anomaly,\n loadingAnomaly,\n errorAnomaly,\n frostCalendar,\n loadingCalendar,\n errorCalendar,\n alertEvents,\n series,\n loadingSeries,\n } = useWeatherIntelligence();\n // FluidGrids-backed automated alert rules for the \"Automated Alert Rules\" widget.\n const { rules, loading: loadingRules, error: errorRules } = useDiseaseWarning();\n const [mapOpen, setMapOpen] = useState(false);\n const [locationOpen, setLocationOpen] = useState(false);\n const [locationInput, setLocationInput] = useState('');\n const [savingLocation, setSavingLocation] = useState(false);\n\n const navigate = useNavigate();\n // buildPath gives absolute MFE paths; bare navigate(buildPath('weather/forecast')) resolves\n // relative to /healthybowl/weather → /healthybowl/forecast (404).\n const { buildPath } = useBasePath();\n const { t: translate } = useI18n();\n const t = useCallback(\n (key: string, fallback: string, vars?: Record<string, string | number>): string => {\n const resolved = translate(key);\n const base = resolved === key ? fallback : resolved;\n if (!vars) return base;\n return Object.entries(vars).reduce(\n (str, [varKey, varValue]) => str.replace(`{{${varKey}}}`, String(varValue)),\n base\n );\n },\n [translate]\n );\n const { toasts, toast, dismiss } = useToast();\n const defaultCurrent = {\n temperature: 0,\n condition: 'N/A',\n feelsLike: 0,\n humidity: 0,\n windSpeed: 0,\n windDirection: '',\n uvIndex: 0,\n pressure: 0,\n visibility: 0,\n icon: '',\n };\n const current = weatherData?.current ?? defaultCurrent;\n const forecast = weatherData?.forecast ?? [];\n const alerts = weatherData?.alerts ?? [];\n const location = weatherData?.location ?? '';\n const weatherMapCenter =\n typeof weatherData?.latitude === 'number' && typeof weatherData?.longitude === 'number'\n ? { lat: weatherData.latitude, lng: weatherData.longitude }\n : null;\n\n // No resolved location AND no forecast points => the svc has nowhere to fetch\n // weather for. Render an honest empty-state with a CTA rather than the\n // all-zeros default that looks like real (but fake) data.\n const needsLocation = location === '' && forecast.length === 0;\n const todayForecast =\n forecast[0] ??\n ({\n high: current.temperature,\n low: current.temperature,\n precipitation: 0,\n humidity: current.humidity,\n windSpeed: current.windSpeed,\n } as const);\n\n const uvLabel = useCallback(\n (uv: number): string => {\n const level = getUVLevel(uv);\n const labels: Record<UVLevel, string> = {\n low: t('healthybowl.weather.overview.uv.low', 'Low'),\n moderate: t('healthybowl.weather.overview.uv.moderate', 'Moderate'),\n high: t('healthybowl.weather.overview.uv.high', 'High'),\n veryHigh: t('healthybowl.weather.overview.uv.veryHigh', 'Very High'),\n extreme: t('healthybowl.weather.overview.uv.extreme', 'Extreme'),\n };\n return labels[level];\n },\n [t]\n );\n\n const openLocationModal = useCallback(() => {\n setLocationInput(farm.location ?? '');\n setLocationOpen(true);\n }, [farm.location]);\n\n // Set the farm's weather location: geocode the free-text place client-side\n // (Open-Meteo, keyless), then persist via updateFarm (or createFarm when no\n // farm exists yet) with the resolved lat/lng so the svc can fetch weather for\n // the new place, and refetch the weather query.\n const handleSaveLocation = useCallback(async () => {\n const place = locationInput.trim();\n if (!place) {\n toast({\n title: t('healthybowl.weather.overview.location.toast.required.title', 'Location required'),\n description: t(\n 'healthybowl.weather.overview.location.toast.required.description',\n 'Enter a town, city, or region to set your farm location.'\n ),\n variant: 'warning',\n });\n return;\n }\n setSavingLocation(true);\n try {\n const hit = await geocodePlace(place);\n const coords = hit ? { latitude: hit.latitude, longitude: hit.longitude } : {};\n if (farm.id) {\n await updateFarm({ id: farm.id, location: place, ...coords });\n } else {\n // Minimal farm bootstrap so weather has a home; the profile page fills the rest.\n await createFarm({\n name: t('healthybowl.weather.overview.location.defaultFarmName', 'My Farm'),\n location: place,\n owner: '',\n totalArea: 0,\n areaUnit: 'acres',\n organicCertified: false,\n ...coords,\n });\n }\n toast({\n title: t('healthybowl.weather.overview.location.toast.saved.title', 'Location set'),\n description: hit\n ? t('healthybowl.weather.overview.location.toast.saved.resolved', 'Weather will load for {{place}}.', {\n place: [hit.name, hit.admin1, hit.country].filter(Boolean).join(', ') || place,\n })\n : t(\n 'healthybowl.weather.overview.location.toast.saved.unresolved',\n 'Saved \"{{place}}\". We could not resolve exact coordinates — the server will try to geocode it.',\n { place }\n ),\n variant: 'success',\n });\n setLocationOpen(false);\n await refetch();\n } catch (err) {\n toast({\n title: t('healthybowl.weather.overview.location.toast.failed.title', 'Could not set location'),\n description: err instanceof Error ? err.message : String(err),\n variant: 'error',\n });\n } finally {\n setSavingLocation(false);\n }\n }, [locationInput, farm.id, updateFarm, createFarm, refetch, toast, t]);\n\n // Derive farming recommendations from actual weather conditions\n const farmingRecommendations = useMemo(() => {\n const recs: { id: string; title: string; description: string; icon: typeof TrendingUp; iconColor: string }[] = [];\n if (current.humidity >= 40 && current.humidity <= 70 && current.temperature >= 15 && current.temperature <= 30) {\n recs.push({\n id: 'goodIrrigation',\n title: t('healthybowl.weather.overview.recommendations.goodIrrigation.title', 'Good conditions for irrigation'),\n description: t(\n 'healthybowl.weather.overview.recommendations.goodIrrigation.description',\n 'Humidity at {{humidity}}% and {{temperature}}°C are optimal for watering crops',\n { humidity: current.humidity, temperature: current.temperature }\n ),\n icon: TrendingUp,\n iconColor: 'text-success',\n });\n } else if (current.humidity > 70) {\n recs.push({\n id: 'skipIrrigation',\n title: t('healthybowl.weather.overview.recommendations.skipIrrigation.title', 'Skip irrigation today'),\n description: t(\n 'healthybowl.weather.overview.recommendations.skipIrrigation.description',\n 'Humidity is high at {{humidity}}% — soil moisture is likely adequate',\n { humidity: current.humidity }\n ),\n icon: Droplets,\n iconColor: 'text-info',\n });\n } else {\n recs.push({\n id: 'increaseIrrigation',\n title: t('healthybowl.weather.overview.recommendations.increaseIrrigation.title', 'Increase irrigation'),\n description: t(\n 'healthybowl.weather.overview.recommendations.increaseIrrigation.description',\n 'Low humidity at {{humidity}}% — crops may need extra watering',\n { humidity: current.humidity }\n ),\n icon: AlertTriangle,\n iconColor: 'text-warning',\n });\n }\n const rainForecast = forecast.find((d) => d.precipitation > 50);\n if (rainForecast) {\n recs.push({\n id: 'heavyRain',\n title: t('healthybowl.weather.overview.recommendations.heavyRain.title', 'Prepare for heavy rain'),\n description: t(\n 'healthybowl.weather.overview.recommendations.heavyRain.description',\n '{{precipitation}}% precipitation expected on {{day}} — ensure proper drainage',\n {\n precipitation: rainForecast.precipitation,\n day: new Date(rainForecast.date).toLocaleDateString('en-US', { weekday: 'short' }),\n }\n ),\n icon: AlertTriangle,\n iconColor: 'text-warning',\n });\n }\n if (current.windSpeed > 20) {\n recs.push({\n id: 'windSensitive',\n title: t('healthybowl.weather.overview.recommendations.windSensitive.title', 'Monitor wind-sensitive crops'),\n description: t(\n 'healthybowl.weather.overview.recommendations.windSensitive.description',\n 'Wind at {{windSpeed}} km/h {{windDirection}} — check support structures for tall crops',\n { windSpeed: current.windSpeed, windDirection: current.windDirection }\n ),\n icon: Wind,\n iconColor: 'text-info',\n });\n }\n if (current.uvIndex >= 8) {\n recs.push({\n id: 'highUV',\n title: t('healthybowl.weather.overview.recommendations.highUV.title', 'High UV exposure'),\n description: t(\n 'healthybowl.weather.overview.recommendations.highUV.description',\n 'UV index at {{uvIndex}} ({{uvLabel}}) — consider shade protection for sensitive crops',\n { uvIndex: current.uvIndex, uvLabel: uvLabel(current.uvIndex) }\n ),\n icon: AlertTriangle,\n iconColor: 'text-status-error-text',\n });\n }\n if (recs.length === 0) {\n recs.push({\n id: 'stable',\n title: t('healthybowl.weather.overview.recommendations.stable.title', 'Conditions are stable'),\n description: t(\n 'healthybowl.weather.overview.recommendations.stable.description',\n 'No immediate weather concerns for farming operations'\n ),\n icon: TrendingUp,\n iconColor: 'text-success',\n });\n }\n return recs;\n }, [current, forecast, t, uvLabel]);\n\n // Derive weather impact metrics from forecast/alert data\n const weatherImpactMetrics = useMemo(() => {\n const levelLow = t('healthybowl.weather.overview.impact.levels.low', 'Low');\n const levelModerate = t('healthybowl.weather.overview.impact.levels.moderate', 'Moderate');\n const levelHigh = t('healthybowl.weather.overview.impact.levels.high', 'High');\n\n const tempScore =\n current.temperature >= 15 && current.temperature <= 30\n ? 90\n : current.temperature >= 10 && current.temperature <= 35\n ? 60\n : 30;\n const humidityScore = current.humidity >= 40 && current.humidity <= 70 ? 85 : 50;\n const growthPercent = Math.round((tempScore + humidityScore) / 2);\n const growthLevel =\n growthPercent >= 80\n ? t('healthybowl.weather.overview.impact.levels.excellent', 'Excellent')\n : growthPercent >= 60\n ? t('healthybowl.weather.overview.impact.levels.good', 'Good')\n : growthPercent >= 40\n ? levelModerate\n : t('healthybowl.weather.overview.impact.levels.poor', 'Poor');\n const growthColor = growthPercent >= 60 ? 'bg-success' : growthPercent >= 40 ? 'bg-warning' : 'bg-status-error-bg';\n\n const severeAlerts = alerts.filter((a) => a.severity === 'extreme' || a.severity === 'severe').length;\n const diseasePercent = Math.min(100, Math.round((current.humidity / 100) * 60 + severeAlerts * 15));\n const diseaseLevel = diseasePercent >= 70 ? levelHigh : diseasePercent >= 40 ? levelModerate : levelLow;\n const diseaseColor =\n diseasePercent >= 70 ? 'bg-status-error-bg' : diseasePercent >= 40 ? 'bg-warning' : 'bg-success';\n\n const windFactor = Math.min(100, Math.round((current.windSpeed / 50) * 100));\n const pestPercent = Math.min(100, Math.round(windFactor * 0.4 + (current.temperature > 25 ? 30 : 10)));\n const pestLevel = pestPercent >= 60 ? levelHigh : pestPercent >= 30 ? levelModerate : levelLow;\n const pestColor = pestPercent >= 60 ? 'bg-status-error-bg' : pestPercent >= 30 ? 'bg-warning' : 'bg-success';\n\n const avgPrecip = forecast.length > 0 ? forecast.reduce((s, d) => s + d.precipitation, 0) / forecast.length : 0;\n const irrigationPercent = Math.max(0, Math.min(100, Math.round(100 - avgPrecip - current.humidity * 0.5)));\n const irrigationLevel = irrigationPercent >= 60 ? levelHigh : irrigationPercent >= 30 ? levelModerate : levelLow;\n const irrigationColor =\n irrigationPercent >= 60 ? 'bg-status-error-bg' : irrigationPercent >= 30 ? 'bg-warning' : 'bg-info';\n\n return [\n {\n id: 'cropGrowth',\n label: t('healthybowl.weather.overview.impact.cropGrowth.label', 'Crop Growth Conditions'),\n level: growthLevel,\n percent: growthPercent,\n color: growthColor,\n },\n {\n id: 'diseaseRisk',\n label: t('healthybowl.weather.overview.impact.diseaseRisk.label', 'Disease Risk'),\n level: diseaseLevel,\n percent: diseasePercent,\n color: diseaseColor,\n },\n {\n id: 'pestActivity',\n label: t('healthybowl.weather.overview.impact.pestActivity.label', 'Pest Activity'),\n level: pestLevel,\n percent: pestPercent,\n color: pestColor,\n },\n {\n id: 'irrigationNeed',\n label: t('healthybowl.weather.overview.impact.irrigationNeed.label', 'Irrigation Need'),\n level: irrigationLevel,\n percent: irrigationPercent,\n color: irrigationColor,\n },\n ];\n }, [current, forecast, alerts, t]);\n\n // Top alert BANNERS: prefer live fired alert events that still need attention\n // (status !== 'handled'); fall back to the forecast-derived weatherData.alerts\n // when no early-warning events are active. Never fabricate — empty stays empty.\n const alertBanners = useMemo(() => {\n const activeEvents = alertEvents.filter((e) => e.status !== 'handled');\n if (activeEvents.length > 0) {\n return activeEvents.slice(0, 3).map((e) => ({\n id: e.id,\n icon: alertTypeIcon(e.alertType),\n classes: eventBannerClasses(e.severity),\n title: e.title,\n detail: e.advisory ?? '',\n }));\n }\n return alerts.slice(0, 3).map((a) => ({\n id: a.id,\n icon: inferAlertIcon(`${a.title} ${a.description ?? ''}`),\n classes: forecastAlertBannerClasses(a.severity),\n title: a.title,\n detail: a.description ?? '',\n }));\n }, [alertEvents, alerts]);\n\n // Tiny sparkline series for the Anomaly Detector — this season's monthly\n // rainfall from the anomaly report (each value real, no synthesis).\n const anomalySparkline = useMemo(\n () => (anomaly?.monthlyRainfall ?? []).map((m) => ({ month: m.monthName, value: m.currentValue })),\n [anomaly]\n );\n\n // Wettest baseline month for the bottom stat card, derived from the synced\n // history baseline (max avgRainfall). Null when history has not synced yet.\n const wettestMonth = useMemo(() => {\n const baseline = series?.baseline ?? [];\n if (baseline.length === 0) return null;\n return baseline.reduce((max, b) => (b.avgRainfall > max.avgRainfall ? b : max), baseline[0]);\n }, [series]);\n\n // Absolute-path sub-navigation for the weather section (buildPath → /healthybowl/weather/<x>).\n const weatherSubNav: { id: string; label: string; icon: typeof Calendar; path: string }[] = [\n {\n id: 'forecast',\n label: t('healthybowl.weather.subnav.forecast', 'Forecast'),\n icon: Calendar,\n path: 'weather/forecast',\n },\n {\n id: 'history',\n label: t('healthybowl.weather.subnav.history', 'History'),\n icon: TrendingUp,\n path: 'weather/history',\n },\n { id: 'alerts', label: t('healthybowl.weather.subnav.alerts', 'Alerts'), icon: Bell, path: 'weather/alerts' },\n {\n id: 'calendar',\n label: t('healthybowl.weather.subnav.calendar', 'Calendar'),\n icon: CalendarDays,\n path: 'weather/calendar',\n },\n {\n id: 'anomaly',\n label: t('healthybowl.weather.subnav.anomaly', 'Anomaly'),\n icon: BarChart3,\n path: 'weather/anomaly',\n },\n {\n id: 'alert-rules',\n label: t('healthybowl.weather.subnav.alertRules', 'Alert Rules'),\n icon: Workflow,\n path: 'weather/alert-rules',\n },\n {\n id: 'alert-history',\n label: t('healthybowl.weather.subnav.alertHistory', 'Alert History'),\n icon: History,\n path: 'weather/alert-history',\n },\n {\n id: 'settings',\n label: t('healthybowl.weather.subnav.settings', 'Settings'),\n icon: Settings2,\n path: 'weather/settings',\n },\n ];\n\n const rainfallDeviationPct = anomaly ? Math.round(anomaly.rainfallDeviationPct) : 0;\n const historicalFirstFrost = formatShortDate(frostCalendar?.historicalFirstFrost);\n\n return (\n <PageLayout\n title={t('healthybowl.weather.overview.title', 'Weather Dashboard')}\n description={t(\n 'healthybowl.weather.overview.description',\n 'Real-time weather data and forecasts for {{location}}',\n {\n location,\n }\n )}\n purpose=\"Today's conditions and the days ahead for your farm in one view. Check the weather before you head out, and jump into the full forecast, history or alerts when you need to plan or react.\"\n nextStepsKey=\"healthybowl-weather-overview\"\n nextStepsTitle=\"Plan around the weather\"\n nextSteps={[\n {\n id: 'forecast',\n label: 'See the full forecast',\n description: 'Plan field work around the 7-day outlook.',\n onClick: () => navigate(buildPath('weather/forecast')),\n },\n {\n id: 'alerts',\n label: 'Set up weather alerts',\n description: 'Get warned about frost, heat or heavy rain in time to act.',\n onClick: () => navigate(buildPath('weather/alerts')),\n },\n {\n id: 'history',\n label: 'Review weather history',\n description: 'Compare past seasons to plan planting and irrigation.',\n onClick: () => navigate(buildPath('weather/history')),\n },\n ]}\n actions={\n !needsLocation && !loadings.weather && !errors.weather ? (\n <Button variant=\"outline\" size=\"sm\" onClick={openLocationModal}>\n <MapPin className=\"h-4 w-4 text-text-secondary\" />\n {t('healthybowl.weather.overview.actions.changeLocation', 'Change location')}\n </Button>\n ) : undefined\n }\n >\n {loadings.weather ? (\n <PageLoader />\n ) : errors.weather ? (\n <ErrorState onRetry={refetch} />\n ) : needsLocation ? (\n <EmptyState\n illustration=\"empty-generic\"\n title={t('healthybowl.weather.overview.emptyState.title', 'No farm location set')}\n description={t(\n 'healthybowl.weather.overview.emptyState.description',\n 'Weather forecasts need a location. Set your farm location to see real-time conditions, a 7-day forecast, and farming recommendations.'\n )}\n action={\n <Button onClick={openLocationModal}>\n <MapPin className=\"h-4 w-4\" />\n {t('healthybowl.weather.overview.emptyState.action', 'Set your farm location')}\n </Button>\n }\n />\n ) : (\n <>\n {/* Top alert BANNERS — active early-warning events, else live forecast alerts */}\n {alertBanners.length > 0 && (\n <div className=\"grid grid-cols-1 gap-3 lg:grid-cols-3\">\n {alertBanners.map((banner) => {\n const Icon = banner.icon;\n return (\n <div key={banner.id} className={`flex items-start gap-3 rounded-lg p-4 ${banner.classes}`}>\n <Icon className=\"mt-0.5 h-5 w-5 shrink-0\" />\n <div className=\"min-w-0\">\n <p className=\"text-sm font-semibold\">{banner.title}</p>\n {banner.detail && <p className=\"mt-0.5 text-xs opacity-90\">{banner.detail}</p>}\n </div>\n </div>\n );\n })}\n </div>\n )}\n\n {/* Weather section sub-navigation (absolute MFE paths via buildPath) */}\n <div className=\"flex flex-wrap gap-2\">\n {weatherSubNav.map((item) => {\n const Icon = item.icon;\n return (\n <button\n key={item.id}\n type=\"button\"\n onClick={() => navigate(buildPath(item.path))}\n className=\"inline-flex items-center gap-1.5 rounded-full border border-border-subtle bg-bg-surface px-3 py-1.5 text-xs font-medium text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary\"\n >\n <Icon className=\"h-3.5 w-3.5\" />\n {item.label}\n </button>\n );\n })}\n </div>\n\n {/* Quick Navigation */}\n <div className=\"grid grid-cols-2 gap-3 md:grid-cols-4\">\n <Button variant=\"outline\" onClick={() => navigate(buildPath('weather/forecast'))}>\n <Calendar className=\"h-4 w-4 text-text-secondary\" />\n {t('healthybowl.weather.overview.quickNav.extendedForecast', 'Extended Forecast')}\n </Button>\n <Button variant=\"outline\" onClick={() => navigate(buildPath('weather/alerts'))}>\n <Bell className=\"h-4 w-4 text-text-secondary\" />\n {t('healthybowl.weather.overview.quickNav.alertSettings', 'Alert Settings')}\n </Button>\n <Button variant=\"outline\" onClick={() => navigate(buildPath('weather/history'))}>\n <TrendingUp className=\"h-4 w-4 text-text-secondary\" />\n {t('healthybowl.weather.overview.quickNav.historicalData', 'Historical Data')}\n </Button>\n <Button variant=\"outline\" onClick={() => setMapOpen(true)}>\n <MapPin className=\"h-4 w-4 text-text-secondary\" />{' '}\n {t('healthybowl.weather.overview.quickNav.weatherMaps', 'Weather Maps')}\n </Button>\n </div>\n\n {/* Weather Alerts */}\n {alerts.length > 0 && (\n <div className=\"space-y-3\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-base font-semibold text-text-primary\">\n {t('healthybowl.weather.overview.alerts.heading', 'Weather Alerts')}\n </h2>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => navigate(buildPath('weather/alerts'))}\n className=\"gap-1 text-text-secondary hover:text-text-primary\"\n >\n {t('healthybowl.weather.overview.alerts.manage', 'Manage Alerts')}{' '}\n <ChevronRight className=\"h-3.5 w-3.5\" />\n </Button>\n </div>\n {alerts.map((alert) => (\n <div\n key={alert.id}\n className={`rounded-lg border border-border-subtle border-l-4 bg-bg-surface p-4 ${severityBorder(alert.severity)}`}\n >\n <div className=\"flex items-start gap-3\">\n <AlertTriangle className=\"mt-0.5 h-5 w-5 shrink-0 text-warning\" />\n <div className=\"flex-1\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <h3 className=\"text-sm font-medium text-text-primary\">{alert.title}</h3>\n <StatusBadge label={alert.severity} variant={severityVariant(alert.severity)} />\n </div>\n <p className=\"mt-1 text-sm text-text-secondary\">{alert.description}</p>\n <p className=\"mt-1 text-xs text-text-secondary\">\n {t('healthybowl.weather.overview.alerts.affected', 'Affected: {{areas}}', {\n areas: (alert.affectedAreas ?? []).join(', '),\n })}\n </p>\n </div>\n </div>\n </div>\n ))}\n </div>\n )}\n\n {/* Current Weather + Today's Summary */}\n <div className=\"grid grid-cols-1 gap-4 lg:grid-cols-3\">\n {/* Main Current Weather Card */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6 lg:col-span-2\">\n <div className=\"mb-4 flex items-center gap-2\">\n {(() => {\n const Icon = getWeatherIcon(current.condition);\n return <Icon className=\"h-8 w-8 text-text-secondary\" />;\n })()}\n <div>\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t('healthybowl.weather.overview.current.title', 'Current Weather')}\n </h3>\n <p className=\"text-xs text-text-secondary\">\n {t('healthybowl.weather.overview.current.lastUpdated', 'Last updated: {{time}}', {\n time: new Date().toLocaleString(),\n })}\n </p>\n </div>\n </div>\n <div className=\"grid grid-cols-2 gap-6 md:grid-cols-4\">\n {/* Temp */}\n <div className=\"text-center\">\n <div className=\"text-3xl font-bold text-text-primary\">{current.temperature}°C</div>\n <div className=\"text-sm text-text-secondary\">\n {t('healthybowl.weather.overview.current.feelsLike', 'Feels like {{temp}}°C', {\n temp: current.feelsLike,\n })}\n </div>\n <div className=\"mt-1 text-sm font-medium text-text-primary\">{current.condition}</div>\n </div>\n {/* Humidity & Wind */}\n <div className=\"space-y-2\">\n <div className=\"flex items-center gap-2\">\n <Droplets className=\"h-4 w-4 text-info\" />\n <span className=\"text-sm text-text-primary\">\n {t('healthybowl.weather.overview.current.humidity', 'Humidity: {{value}}%', {\n value: current.humidity,\n })}\n </span>\n </div>\n <div className=\"flex items-center gap-2\">\n <Wind className=\"h-4 w-4 text-text-secondary\" />\n <span className=\"text-sm text-text-primary\">\n {t('healthybowl.weather.overview.current.wind', 'Wind: {{speed}} km/h {{direction}}', {\n speed: current.windSpeed,\n direction: current.windDirection,\n })}\n </span>\n </div>\n </div>\n {/* Pressure & Visibility */}\n <div className=\"space-y-2\">\n <div className=\"flex items-center gap-2\">\n <Gauge className=\"h-4 w-4 text-primary\" />\n <span className=\"text-sm text-text-primary\">\n {t('healthybowl.weather.overview.current.pressure', 'Pressure: {{value}} hPa', {\n value: current.pressure,\n })}\n </span>\n </div>\n <div className=\"flex items-center gap-2\">\n <Eye className=\"h-4 w-4 text-success\" />\n <span className=\"text-sm text-text-primary\">\n {t('healthybowl.weather.overview.current.visibility', 'Visibility: {{value}} km', {\n value: current.visibility,\n })}\n </span>\n </div>\n </div>\n {/* UV Index */}\n <div className=\"space-y-2\">\n <div className=\"text-sm\">\n <span className=\"text-text-secondary\">\n {t('healthybowl.weather.overview.current.uvIndex', 'UV Index: ')}\n </span>\n <span className=\"font-medium text-text-primary\">\n {current.uvIndex} ({uvLabel(current.uvIndex)})\n </span>\n </div>\n </div>\n </div>\n </div>\n\n {/* Today's Summary */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t('healthybowl.weather.overview.summary.title', \"Today's Summary\")}\n </h3>\n <div className=\"mt-4 space-y-4\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {t('healthybowl.weather.overview.summary.high', 'High')}\n </span>\n <div className=\"flex items-center gap-1\">\n <ArrowUp className=\"h-3.5 w-3.5 text-status-error-text\" />\n <span className=\"font-medium text-text-primary\">{todayForecast.high}°C</span>\n </div>\n </div>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {t('healthybowl.weather.overview.summary.low', 'Low')}\n </span>\n <div className=\"flex items-center gap-1\">\n <ArrowDown className=\"h-3.5 w-3.5 text-info\" />\n <span className=\"font-medium text-text-primary\">{todayForecast.low}°C</span>\n </div>\n </div>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {t('healthybowl.weather.overview.summary.precipitation', 'Precipitation')}\n </span>\n <span className=\"font-medium text-text-primary\">{todayForecast.precipitation}%</span>\n </div>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {t('healthybowl.weather.overview.summary.humidity', 'Humidity')}\n </span>\n <span className=\"font-medium text-text-primary\">{todayForecast.humidity}%</span>\n </div>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {t('healthybowl.weather.overview.summary.windSpeed', 'Wind Speed')}\n </span>\n <span className=\"font-medium text-text-primary\">{todayForecast.windSpeed} km/h</span>\n </div>\n </div>\n </div>\n </div>\n\n {/* 7-Day Forecast */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <div className=\"mb-4 flex items-center justify-between\">\n <div>\n <h3 className=\"text-base font-semibold text-text-primary\">\n {t('healthybowl.weather.overview.forecast.title', '7-Day Forecast')}\n </h3>\n <p className=\"text-xs text-text-secondary\">\n {t('healthybowl.weather.overview.forecast.subtitle', 'Click on any day for detailed forecast')}\n </p>\n </div>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => navigate(buildPath('weather/forecast'))}\n className=\"gap-1 text-text-secondary hover:text-text-primary\"\n >\n {t('healthybowl.weather.overview.forecast.viewExtended', 'View Extended Forecast')}{' '}\n <ChevronRight className=\"h-3.5 w-3.5\" />\n </Button>\n </div>\n <div className=\"space-y-2\">\n {forecast.slice(0, 7).map((day, index) => {\n const Icon = getWeatherIcon(day.condition);\n return (\n <div\n key={day.date}\n onClick={() => navigate(buildPath('weather/forecast'))}\n className=\"flex cursor-pointer items-center justify-between rounded-lg px-3 py-2.5 transition-colors hover:bg-bg-sunken/50\"\n >\n <div className=\"flex items-center gap-3 flex-1\">\n <span className=\"w-14 text-sm font-medium text-text-primary\">\n {index === 0\n ? t('healthybowl.weather.overview.forecast.today', 'Today')\n : new Date(day.date).toLocaleDateString('en-US', { weekday: 'short' })}\n </span>\n <Icon className=\"h-5 w-5 text-text-secondary\" />\n <span className=\"text-sm text-text-primary\">{day.condition}</span>\n </div>\n <div className=\"flex items-center gap-4 text-sm\">\n <div className=\"flex items-center gap-1\">\n <Droplets className=\"h-3 w-3 text-info\" />\n <span className=\"text-text-primary\">{day.precipitation}%</span>\n </div>\n <div className=\"flex items-center gap-2\">\n <span className=\"font-medium text-text-primary\">{day.high}°</span>\n <span className=\"text-text-secondary\">{day.low}°</span>\n </div>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n\n {/* Farming Recommendations + Weather Impact */}\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-2\">\n {/* Farming Recommendations - derived from current weather data */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <h3 className=\"text-base font-semibold text-text-primary\">\n {t('healthybowl.weather.overview.recommendations.title', 'Farming Recommendations')}\n </h3>\n <p className=\"text-xs text-text-secondary\">\n {t(\n 'healthybowl.weather.overview.recommendations.subtitle',\n 'AI-powered insights based on current conditions'\n )}\n </p>\n <div className=\"mt-4 space-y-3\">\n {farmingRecommendations.map((rec) => {\n const Icon = rec.icon;\n return (\n <div key={rec.id} className=\"flex items-start gap-3 rounded-lg bg-bg-sunken/50 p-3\">\n <Icon className={`mt-0.5 h-5 w-5 shrink-0 ${rec.iconColor}`} />\n <div>\n <p className=\"text-sm font-medium text-text-primary\">{rec.title}</p>\n <p className=\"text-xs text-text-secondary\">{rec.description}</p>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n\n {/* Weather Impact Analysis - derived from forecast/alert data */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <h3 className=\"text-base font-semibold text-text-primary\">\n {t('healthybowl.weather.overview.impact.title', 'Weather Impact Analysis')}\n </h3>\n <p className=\"text-xs text-text-secondary\">\n {t('healthybowl.weather.overview.impact.subtitle', 'Impact on farming operations')}\n </p>\n <div className=\"mt-4 space-y-4\">\n {weatherImpactMetrics.map(({ id, label, level, percent, color }) => (\n <div key={id}>\n <div className=\"mb-1.5 flex items-center justify-between\">\n <span className=\"text-sm font-medium text-text-primary\">{label}</span>\n <span className=\"text-sm font-medium text-text-secondary\">{level}</span>\n </div>\n <div className=\"h-2 w-full rounded-full bg-bg-sunken\">\n <div className={`h-2 rounded-full transition-all ${color}`} style={{ width: `${percent}%` }} />\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n\n {/* Weather-intelligence widgets: Anomaly Detector · Frost-Risk mini · Alert Rules */}\n <div className=\"grid grid-cols-1 gap-4 lg:grid-cols-3\">\n {/* Anomaly Detector */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <div className=\"mb-3 flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <Activity className=\"h-4 w-4 text-info\" />\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t('healthybowl.weather.overview.anomaly.title', 'Anomaly Detector')}\n </h3>\n </div>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => navigate(buildPath('weather/anomaly'))}\n className=\"gap-1 text-text-secondary hover:text-text-primary\"\n >\n {t('healthybowl.weather.overview.anomaly.view', 'View report')}\n <ChevronRight className=\"h-3.5 w-3.5\" />\n </Button>\n </div>\n {loadingAnomaly && !anomaly ? (\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n {t('healthybowl.common.loading', 'Loading…')}\n </div>\n ) : errorAnomaly ? (\n <p className=\"text-sm text-status-error-text\">\n {t('healthybowl.weather.overview.anomaly.error', 'Could not load the anomaly report.')}\n </p>\n ) : !anomaly ? (\n <EmptyState\n illustration=\"empty-generic\"\n title={t('healthybowl.weather.overview.anomaly.empty.title', 'No anomaly data yet')}\n description={t(\n 'healthybowl.weather.overview.anomaly.empty.description',\n 'Sync weather history to compare this season against your baseline.'\n )}\n />\n ) : (\n <>\n {anomalySparkline.length > 0 && (\n <div className=\"h-16 w-full\">\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <AreaChart data={anomalySparkline} margin={{ top: 4, right: 0, bottom: 0, left: 0 }}>\n <Area\n type=\"monotone\"\n dataKey=\"value\"\n stroke=\"var(--color-info)\"\n fill=\"var(--color-info)\"\n fillOpacity={0.15}\n strokeWidth={2}\n isAnimationActive={false}\n />\n </AreaChart>\n </ResponsiveContainer>\n </div>\n )}\n <p className=\"mt-3 text-sm text-text-primary\">\n {rainfallDeviationPct < 0\n ? t(\n 'healthybowl.weather.overview.anomaly.rainfallBelow',\n 'Rainfall {{pct}}% below normal this month',\n { pct: Math.abs(rainfallDeviationPct) }\n )\n : rainfallDeviationPct > 0\n ? t(\n 'healthybowl.weather.overview.anomaly.rainfallAbove',\n 'Rainfall {{pct}}% above normal this month',\n { pct: rainfallDeviationPct }\n )\n : t(\n 'healthybowl.weather.overview.anomaly.rainfallNormal',\n 'Rainfall is close to normal this month'\n )}\n </p>\n <p className=\"mt-1 text-xs text-text-secondary\">\n {t(\n 'healthybowl.weather.overview.anomaly.detail',\n '{{current}}mm so far vs {{baseline}}mm baseline for {{month}}',\n {\n current: Math.round(anomaly.rainfallThisMonthMm),\n baseline: Math.round(anomaly.rainfallBaselineMm),\n month: anomaly.currentMonthName,\n }\n )}\n </p>\n </>\n )}\n </div>\n\n {/* Frost-Risk Calendar mini */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <div className=\"mb-3 flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <CalendarDays className=\"h-4 w-4 text-info\" />\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t('healthybowl.weather.overview.frostCalendar.title', 'Frost-Risk Calendar')}\n </h3>\n </div>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => navigate(buildPath('weather/calendar'))}\n className=\"gap-1 text-text-secondary hover:text-text-primary\"\n >\n {t('healthybowl.weather.overview.frostCalendar.view', 'Open')}\n <ChevronRight className=\"h-3.5 w-3.5\" />\n </Button>\n </div>\n {loadingCalendar && !frostCalendar ? (\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n {t('healthybowl.common.loading', 'Loading…')}\n </div>\n ) : errorCalendar ? (\n <p className=\"text-sm text-status-error-text\">\n {t('healthybowl.weather.overview.frostCalendar.error', 'Could not load the frost-risk calendar.')}\n </p>\n ) : !frostCalendar || frostCalendar.days.length === 0 ? (\n <EmptyState\n illustration=\"empty-generic\"\n title={t('healthybowl.weather.overview.frostCalendar.empty.title', 'No calendar data')}\n description={t(\n 'healthybowl.weather.overview.frostCalendar.empty.description',\n 'Frost-risk days appear here once forecasts and history are available.'\n )}\n />\n ) : (\n <>\n <p className=\"mb-2 text-xs text-text-secondary\">\n {frostCalendar.monthName} ·{' '}\n {t('healthybowl.weather.overview.frostCalendar.count', '{{count}} frost-risk days', {\n count: frostCalendar.frostRiskDayCount,\n })}\n </p>\n <div className=\"grid grid-cols-7 gap-1\">\n {/* Leading spacers so the 1st lands under the correct weekday. */}\n {Array.from({\n length: (() => {\n const first = new Date(frostCalendar.days[0].date);\n return Number.isNaN(first.getTime()) ? 0 : first.getDay();\n })(),\n }).map((_, i) => (\n <div key={`spacer-${i}`} aria-hidden />\n ))}\n {frostCalendar.days.map((cell) => (\n <div\n key={cell.date}\n title={cell.detail ?? cell.label}\n className={`flex aspect-square items-center justify-center rounded text-[11px] font-medium ${frostRiskCellClasses(cell.risk)}`}\n >\n {cell.day}\n </div>\n ))}\n </div>\n </>\n )}\n </div>\n\n {/* Automated Alert Rules (FluidGrids) */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <div className=\"mb-3 flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <Workflow className=\"h-4 w-4 text-info\" />\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t('healthybowl.weather.overview.alertRules.title', 'Automated Alert Rules')}\n </h3>\n </div>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => navigate(buildPath('weather/alert-rules'))}\n className=\"gap-1 text-text-secondary hover:text-text-primary\"\n >\n {t('healthybowl.weather.overview.alertRules.view', 'Manage')}\n <ChevronRight className=\"h-3.5 w-3.5\" />\n </Button>\n </div>\n {loadingRules && rules.length === 0 ? (\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n {t('healthybowl.common.loading', 'Loading…')}\n </div>\n ) : errorRules ? (\n <p className=\"text-sm text-status-error-text\">\n {t('healthybowl.weather.overview.alertRules.error', 'Could not load alert rules.')}\n </p>\n ) : rules.length === 0 ? (\n <EmptyState\n illustration=\"empty-generic\"\n title={t('healthybowl.weather.overview.alertRules.empty.title', 'No alert rules yet')}\n description={t(\n 'healthybowl.weather.overview.alertRules.empty.description',\n 'Create FluidGrids rules to get warned about frost, storms and heat.'\n )}\n />\n ) : (\n <div className=\"space-y-2\">\n {rules.slice(0, 4).map((rule) => (\n <div\n key={rule.id}\n className=\"flex items-center justify-between gap-2 rounded-lg bg-bg-sunken/50 px-3 py-2\"\n >\n <div className=\"min-w-0\">\n <p className=\"truncate text-sm font-medium text-text-primary\">{rule.name}</p>\n <p className=\"truncate text-xs text-text-secondary\">\n {rule.metric} {rule.operator} {rule.threshold}\n {rule.unit ?? ''}\n </p>\n </div>\n <StatusBadge\n label={\n rule.status === 'active'\n ? t('healthybowl.weather.overview.alertRules.active', 'Active')\n : t('healthybowl.weather.overview.alertRules.paused', 'Paused')\n }\n variant={rule.status === 'active' ? 'success' : 'default'}\n />\n </div>\n ))}\n </div>\n )}\n </div>\n </div>\n\n {/* Bottom stat cards: frost days · wettest month · historical avg first-frost */}\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-3\">\n <StatCard\n label={t('healthybowl.weather.overview.stats.frostDays', 'Frost days this season')}\n value={loadingAnomaly && !anomaly ? '—' : anomaly ? anomaly.frostDaysThisSeason : '—'}\n icon={<Snowflake className=\"h-4 w-4\" />}\n />\n <StatCard\n label={t('healthybowl.weather.overview.stats.wettestMonth', 'Wettest month')}\n value={\n loadingSeries && !series\n ? '—'\n : wettestMonth\n ? `${wettestMonth.monthName} ${Math.round(wettestMonth.avgRainfall)}mm`\n : '—'\n }\n icon={<CloudRain className=\"h-4 w-4\" />}\n />\n <StatCard\n label={t('healthybowl.weather.overview.stats.firstFrost', 'Historical avg first-frost')}\n value={loadingCalendar && !frostCalendar ? '—' : (historicalFirstFrost ?? '—')}\n icon={<Calendar className=\"h-4 w-4\" />}\n />\n </div>\n </>\n )}\n\n <Modal\n open={mapOpen}\n onClose={() => setMapOpen(false)}\n title={t('healthybowl.weather.overview.map.title', 'Weather Map')}\n description={\n location\n ? t('healthybowl.weather.overview.map.descriptionNear', 'Live precipitation radar near {{location}}', {\n location,\n })\n : t('healthybowl.weather.overview.map.description', 'Live precipitation radar')\n }\n size=\"xl\"\n >\n {mapOpen && <WeatherMap location={location} center={weatherMapCenter} />}\n </Modal>\n\n {/* Set / change farm weather location */}\n <Modal\n open={locationOpen}\n onClose={() => setLocationOpen(false)}\n title={t('healthybowl.weather.overview.location.modal.title', 'Set farm location')}\n description={t(\n 'healthybowl.weather.overview.location.modal.description',\n 'Enter your farm’s town, city, or region. We use it to fetch local weather and forecasts.'\n )}\n size=\"md\"\n footer={\n <>\n <Button variant=\"outline\" onClick={() => setLocationOpen(false)}>\n {t('healthybowl.common.cancel', 'Cancel')}\n </Button>\n <Button onClick={handleSaveLocation} disabled={savingLocation}>\n {savingLocation && <Loader2 className=\"h-4 w-4 animate-spin\" />}\n {savingLocation\n ? t('healthybowl.weather.overview.location.modal.saving', 'Saving…')\n : t('healthybowl.weather.overview.location.modal.save', 'Save location')}\n </Button>\n </>\n }\n >\n <div>\n <label htmlFor=\"weather-location\" className=\"mb-1 block text-sm font-medium text-text-primary\">\n {t('healthybowl.weather.overview.location.field.label', 'Farm location')}\n </label>\n <input\n id=\"weather-location\"\n type=\"text\"\n value={locationInput}\n onChange={(e) => setLocationInput(e.target.value)}\n placeholder={t('healthybowl.weather.overview.location.field.placeholder', 'e.g., Pune, Maharashtra')}\n className=\"h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n <p className=\"mt-1 text-xs text-text-secondary\">\n {t(\n 'healthybowl.weather.overview.location.field.helper',\n 'We resolve coordinates automatically so the forecast reflects this exact place.'\n )}\n </p>\n </div>\n </Modal>\n\n <ToastContainer toasts={toasts} onDismiss={dismiss} />\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,IAAM,MAAmB,MACvB,MAAM,aAAa,MAAM,WAAY,UAAoB,MAAM,aAAc,YAAuB,QAEhG,MAAkB,MAAc;AACpC,SAAQ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