import React, { useState, useEffect, useCallback, useRef } from 'react';
import {
Plane,
Sun,
QrCode,
Wind,
AlertTriangle,
Briefcase,
Snowflake,
Utensils,
ChevronRight,
ShieldCheck,
Car,
Navigation,
ArrowLeft,
Smartphone,
CloudLightning,
MapPin,
X
} from 'lucide-react';
const apiKey = "";
const DESTINATIONS = [
{ name: "Miami Beach", code: "MIA", carrier: "American Airlines", url: "https://www.aa.com", region: "Florida" },
{ name: "Cancun", code: "CUN", carrier: "JetBlue", url: "https://www.jetblue.com", region: "Mexico" },
{ name: "Malibu", code: "LAX", carrier: "United Airlines", url: "https://www.united.com", region: "California" },
{ name: "New York", code: "JFK", carrier: "Delta", url: "https://www.delta.com", region: "Northeast" }
];
export default function App() {
const [index, setIndex] = useState(0);
const [intel, setIntel] = useState(null);
const [status, setStatus] = useState('syncing');
const [showQr, setShowQr] = useState(false);
const [progress, setProgress] = useState(0);
const [isHeaderFlipped, setIsHeaderFlipped] = useState(false);
const [season, setSeason] = useState('summer');
const [disasterAlert, setDisasterAlert] = useState(null);
useEffect(() => {
const month = new Date().getMonth();
if (month === 10) setSeason('thanksgiving');
else if (month === 11) setSeason('christmas');
else setSeason('summer');
}, []);
const city = DESTINATIONS[index];
const fetchTravelIntel = useCallback(async (targetCity) => {
setStatus('syncing');
setDisasterAlert(null);
const prompt = `TNW News Transit Analysis for ${targetCity.name}.
Season: ${season}.
1. Check for hurricane/shutdown in ${targetCity.region}.
2. Analyze road conditions for Uber/Rental cars.
3. Return JSON: { "price": number, "isAirportOpen": boolean, "disasterType": "string|null", "holidayComparison": "string", "weatherVibe": "string", "transitSafety": "high|medium|low" }`;
try {
const response = await fetch(
`https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-preview-09-2025:generateContent?key=${apiKey}`,
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
contents: [{ parts: [{ text: prompt }] }],
generationConfig: { responseMimeType: "application/json" }
})
}
);
const result = await response.json();
const data = JSON.parse(result.candidates?.[0]?.content?.parts?.[0]?.text);
if (!data.isAirportOpen) {
setDisasterAlert(`${targetCity.name} AIRPORT SHUTDOWN: ${data.disasterType}`);
setTimeout(() => setIndex(prev => (prev + 1) % DESTINATIONS.length), 3000);
return;
}
setIntel(data);
setStatus('ready');
} catch (err) {
setIntel({ price: 249, isAirportOpen: true, holidayComparison: "Saved $120 vs last year", weatherVibe: "Clear Skies", transitSafety: "high" });
setStatus('ready');
}
}, [season]);
useEffect(() => {
fetchTravelIntel(DESTINATIONS[index]);
}, [index, fetchTravelIntel]);
useEffect(() => {
const cycle = setInterval(() => {
setProgress(p => (p >= 100 ? 0 : p + 1));
}, 150);
return () => clearInterval(cycle);
}, []);
const getThemeStyles = () => {
if (season === 'thanksgiving') return { bg: 'bg-orange-950', accent: 'text-orange-400', icon:
Your Trustworthy Local and National Weather News for Your Neighborhood Online
{disasterAlert ? "Hazard Reroute" : (season === 'summer' ? 'Summer Forecast' : `${season} Specials`)}
{city.name}
Safety Status
{intel?.transitSafety === 'low' ? 'Caution Advised' : 'Safe to Drive'}
{disasterAlert}
{intel?.holidayComparison}
Forecast Stability
{intel?.weatherVibe || 'Syncing...'}
Provider
{city.carrier}
Availability
Confirmed
Secure Link generated by TNW LLC Network.
Scanning takes you to official booking portal.
As hot, humid and even hazy conditions continue for another day in the Chicago area, severe thunderstorm warnings have also begun to take hold Wednesday morning. As of 8:40 a.m. Wednesday, severe thunderstorm warnings were issued for DuPage, Lake, Kane, Kenosha, McHenry and parts of Cook County. "This storm has had a history of 60 to 70 mile per hour wind gusts and tree damage," an alert from the National Weather Service said. "Expect considerable tree damage," the alert said, adding that counties under the warning could also expect "penny-sized hail."
Original post: https://www.nbcchicago.com/weather/chicago-radar-severe-weather-thunderstorms/3194396/
Our breaking News center team is always here 24/7. Don't hesitate to send Weather News that is breaking in your local Area.