feat: implement external API integration with static tide tables (task 32)
- Add in-memory caching for external API responses (6-hour expiration) - Implement OpenWeatherMap integration for weather data - Create static tide tables for 22 Irish coastal stations - Add tide calculation based on semi-diurnal patterns and lunar cycles - Implement water quality, beach quality, and biodiversity placeholder endpoints - Add comprehensive API documentation (EXTERNAL_API_SETUP.md) - Fix frontend WaterQualityIndicator crash - Remove Redis dependency (using in-memory cache instead) - All external data endpoints functional and tested
This commit is contained in:
@@ -62,7 +62,7 @@ export function WaterQualityIndicator({ latitude, longitude }: WaterQualityIndic
|
||||
);
|
||||
}
|
||||
|
||||
const statusConfig = {
|
||||
const statusConfig: Record<string, { color: string; text: string; icon: string }> = {
|
||||
excellent: { color: 'bg-green-500', text: 'Excellent', icon: '✓' },
|
||||
good: { color: 'bg-blue-500', text: 'Good', icon: '✓' },
|
||||
sufficient: { color: 'bg-yellow-500', text: 'Sufficient', icon: '!' },
|
||||
@@ -70,7 +70,7 @@ export function WaterQualityIndicator({ latitude, longitude }: WaterQualityIndic
|
||||
unknown: { color: 'bg-gray-400', text: 'Unknown', icon: '?' },
|
||||
};
|
||||
|
||||
const config = statusConfig[waterQuality.status];
|
||||
const config = statusConfig[waterQuality.status] || statusConfig.unknown;
|
||||
|
||||
return (
|
||||
<div className="bg-white rounded-lg shadow p-4">
|
||||
|
||||
Reference in New Issue
Block a user