import React, { useState, useEffect } from 'react';
import * as API from '../api.js';
export default function DineoutSniperView({ onBack }) {
const [data, setData] = useState(null);
const [loading, setLoading] = useState(true);
const [mode, setMode] = useState('sniper'); // 'sniper' or 'grid'
useEffect(() => {
API.fetchDineoutSniper().then((res) => {
if (res && res.venues) setData(res);
setLoading(false);
});
}, []);
return (
{/* Top Header */}
arrow_back
MODULE 4 • DINEOUT SLOT SNIPER
Dineout Slot Sniper Scored.
{/* Industry Differentiation Showcase Card */}
HYPERFLOW ARCHITECTURAL DIFFERENTIATION
DYNAMIC SLOT PRESSURE SCORING
Dynamic Slot Pressure Velocity vs Static Booking Grids
Standard booking apps show unranked, static availability grids. HyperFlow evaluates real-time dining velocity (rating, peak hours, weekend factors) to score slot pressure and estimate exact fill time in minutes.
setMode('sniper')}
className={`px-4 py-1.5 rounded-full text-xs font-bold transition-all cursor-pointer ${
mode === 'sniper'
? 'bg-gradient-to-r from-amber-500 to-orange-500 text-black shadow-md font-bold'
: 'text-white/60 hover:text-white'
}`}
>
HyperFlow Slot Sniper
setMode('grid')}
className={`px-4 py-1.5 rounded-full text-xs font-bold transition-all cursor-pointer ${
mode === 'grid'
? 'bg-red-500/30 text-red-300 border border-red-500/50 shadow-md'
: 'text-white/60 hover:text-white'
}`}
>
Standard Static Grid
{loading ? (
Fetching Dineout slot predictions...
) : (
{(data?.venues || []).map((venue, i) => (
{venue.venue_name}
RATING: {venue.rating}
{venue.cuisine}
{mode === 'sniper' ? 'SNIPED SLOT VELOCITY:' : 'STATIC AVAILABLE TIMES:'}
{venue.slots?.map((s, idx) => (
{s.time_slot}
{mode === 'sniper' ? (
Fills in ~{s.estimated_minutes_to_full}m
Demand: {s.demand_score}
) : (
Available
)}
))}
alert(`Slot booked at ${venue.venue_name}!`)}
className="w-full py-3 bg-gradient-to-r from-amber-500 to-orange-500 hover:opacity-90 text-black font-mono font-bold rounded-full text-xs transition-all cursor-pointer mt-4"
>
Snipe Slot Now
))}
)}
);
}