Add TFR warning banner for airspace restrictions
Fetches active Temporary Flight Restrictions from the FAA website, filters by configured state (LOCATION_STATE env var), and displays a red warning banner at the top of the dashboard when TFRs are present. Data is cached for 30 minutes and degrades gracefully if the FAA is unreachable. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
ForecastResponse,
|
||||
HistoricalResponse,
|
||||
AssessmentResponse,
|
||||
TFRResponse,
|
||||
Thresholds,
|
||||
APIError,
|
||||
} from './types'
|
||||
@@ -166,6 +167,13 @@ class APIClient {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get active TFRs (Temporary Flight Restrictions) near the configured location
|
||||
*/
|
||||
async getTfrs(): Promise<TFRResponse> {
|
||||
return this.request<TFRResponse>('/airspace/tfrs')
|
||||
}
|
||||
|
||||
/**
|
||||
* Assess current conditions with custom thresholds
|
||||
*/
|
||||
@@ -200,6 +208,8 @@ export const getForecast = (lat?: number, lon?: number) =>
|
||||
export const getHistorical = (date: string, lat?: number, lon?: number) =>
|
||||
apiClient.getHistorical(date, lat, lon)
|
||||
|
||||
export const getTfrs = () => apiClient.getTfrs()
|
||||
|
||||
export const assessWithThresholds = (
|
||||
thresholds: Thresholds,
|
||||
lat?: number,
|
||||
|
||||
Reference in New Issue
Block a user