import React, { useState } from 'react'; import ReactDOM from 'react-dom/client'; import { Car, Phone, ShieldCheck, ArrowRight, Menu, X, Facebook, Twitter, Instagram, Clock, MapPin, IndianRupee, Shield, Play, Loader2, AlertCircle, Sparkles } from 'lucide-react'; import { GoogleGenAI } from "@google/genai"; // --- TYPES --- interface CarModel { name: string; category: 'Hatchback' | 'Sedan' | 'SUV' | 'Luxury'; image: string; } interface Feature { title: string; description: string; icon: React.ReactNode; } enum VideoStatus { IDLE = 'IDLE', CHECKING_KEY = 'CHECKING_KEY', GENERATING = 'GENERATING', COMPLETED = 'COMPLETED', ERROR = 'ERROR' } // Accessing window properties through type casting for browser-side Babel compatibility const aistudio = (window as any).aistudio; // --- CONSTANTS --- const BOOKING_NUMBER = "7530009998"; const CAR_MODELS: CarModel[] = [ { name: 'Swift', category: 'Hatchback', image: 'https://images.unsplash.com/photo-1590362891991-f776e747a588?auto=format&fit=crop&q=80&w=400' }, { name: 'Etios', category: 'Sedan', image: 'https://images.unsplash.com/photo-1549317661-bd32c8ce0db2?auto=format&fit=crop&q=80&w=400' }, { name: 'Innova', category: 'SUV', image: 'https://images.unsplash.com/photo-1533473359331-0135ef1b58bf?auto=format&fit=crop&q=80&w=400' }, { name: 'Xylo', category: 'SUV', image: 'https://images.unsplash.com/photo-1552519507-da3b142c6e3d?auto=format&fit=crop&q=80&w=400' }, { name: 'Desire', category: 'Sedan', image: 'https://images.unsplash.com/photo-1583121274602-3e2820bc49dd?auto=format&fit=crop&q=80&w=400' }, { name: 'Tavera', category: 'SUV', image: 'https://images.unsplash.com/photo-1541899481282-d53bffe3c35d?auto=format&fit=crop&q=80&w=400' }, ]; const FEATURES: Feature[] = [ { title: 'One-Way Fares', description: 'Only pay for the distance you travel. No return charges. Save up to 40% on every trip.', icon: }, { title: '24/7 Availability', description: 'Need a ride at 3 AM? We are always ready to serve you across all major routes.', icon: }, { title: 'Wide Network', description: 'Covering inter-city routes across the country with reliable GPS-enabled tracking.', icon: }, { title: 'Safe & Comfortable', description: 'Luxurious, well-maintained vehicles driven by professional and verified chauffeurs.', icon: } ]; const COMPANY_STORY = `One Way Cab Taxi is an Indian company providing call taxi service with oneway fare. We identified that market taxis charge two ways, usually citing the reason of returning empty. We changed that by charging only one way, saving customers up to 40%. From Indica to Innova, our fleet is luxurious and available 24x7. Established in 2016, we pride ourselves on transparency and comfort.`; // --- COMPONENTS --- const VideoGenerator: React.FC = () => { const [status, setStatus] = useState(VideoStatus.IDLE); const [videoUrl, setVideoUrl] = useState(null); const [error, setError] = useState(null); const generateVideo = async () => { try { setStatus(VideoStatus.CHECKING_KEY); const hasKey = aistudio ? await aistudio.hasSelectedApiKey() : false; if (!hasKey && aistudio) { await aistudio.openSelectKey(); } setStatus(VideoStatus.GENERATING); // Fix: Follow guidelines to use process.env.API_KEY directly in constructor const ai = new GoogleGenAI({ apiKey: process.env.API_KEY }); const prompt = `A cinematic high-quality promotional video for an Indian taxi service called "One Way Cab Taxi". Show a sleek yellow and white taxi driving through scenic Indian roads, bridges, and city streets. The text "SAVE 40% ON ONE WAY TRIPS" appears gracefully. The atmosphere is professional, reliable, and modern. 1080p, smooth motion.`; let operation = await ai.models.generateVideos({ model: 'veo-3.1-fast-generate-preview', prompt, config: { numberOfVideos: 1, resolution: '1080p', aspectRatio: '16:9' } }); while (!operation.done) { await new Promise(resolve => setTimeout(resolve, 5000)); // Fix: Follow guidelines to create a new instance right before making an API call to ensure current key is used const aiPolling = new GoogleGenAI({ apiKey: process.env.API_KEY }); operation = await aiPolling.operations.getVideosOperation({ operation: operation }); } const downloadLink = operation.response?.generatedVideos?.[0]?.video?.uri; if (downloadLink) { // Fix: Use process.env.API_KEY directly when fetching video data const response = await fetch(`${downloadLink}&key=${process.env.API_KEY}`); const blob = await response.blob(); setVideoUrl(URL.createObjectURL(blob)); setStatus(VideoStatus.COMPLETED); } else { throw new Error("Failed to retrieve video link"); } } catch (err: any) { console.error(err); if (err.message?.includes("Requested entity was not found") && aistudio) { setError("API Key error. Please re-select your key."); aistudio.openSelectKey(); } else { setError("Generation failed. Please try again later."); } setStatus(VideoStatus.ERROR); } }; return (
AI Brand Visualizer

Experience Our Journey

Create a professional cinematic promo for One Way Cab Taxi using our proprietary AI. See how we're changing travel across India.

{status === VideoStatus.IDLE && ( )} {(status === VideoStatus.GENERATING || status === VideoStatus.CHECKING_KEY) && (
Cinematic processing...

Usually takes 1-2 minutes. Your vision is being rendered.

)} {status === VideoStatus.ERROR && (
System Error {error}
)}
{videoUrl ? (
); }; // --- MAIN APP --- const App: React.FC = () => { const [isMenuOpen, setIsMenuOpen] = useState(false); return (
{/* Navigation */}
{/* Hero Section */}
PREMIUM ONE-WAY CAB SERVICE

Premium Drop Trips,
One-Way Fares.

Why pay for the return when you only go one way? Save up to 40% on inter-city travels with India's most trusted cab taxi service.

One Way Cab Taxi Service
{/* AI Video Promo Section */}

Experience the Brand

We believe in transparency and innovation. Use our AI tool below to generate a cinematic view of our journey across India.

{/* Features Grid */}
{FEATURES.map((feature, idx) => (
{React.cloneElement(feature.icon as React.ReactElement, { className: "w-7 h-7" })}

{feature.title}

{feature.description}

))}
{/* Fleet Section */}

Our Luxurious Fleet

Well-maintained vehicles for every travel requirement. From business sedans to luxury multi-seaters.

{CAR_MODELS.map((car, idx) => (
{car.name}
{car.category}

{car.name}

Standard Class

))}
{/* About Section */}

Disrupting the Two-Way
Fare Industry

{COMPANY_STORY}

24/7
Always Available
40%
Avg. Savings
{/* Footer */}
ONEWAYCABTAXI

The most reliable inter-city one-way cab service in India.

Contact

© 2024 One Way Cab Taxi. All rights reserved.

); }; // --- ROOT RENDER --- const rootElement = document.getElementById('root'); if (rootElement) { const root = ReactDOM.createRoot(rootElement); root.render( ); }