import React from 'react'; import type { Flyer } from '../types'; import { DocumentTextIcon } from './icons/DocumentTextIcon'; const formatShortDate = (dateString: string | null | undefined): string | null => { if (!dateString) return null; // Dates from DB are YYYY-MM-DD, which can be interpreted as UTC midnight by new Date(). // Appending T00:00:00 ensures it's not shifted by local timezone. try { return new Date(`${dateString}T00:00:00`).toLocaleDateString('en-US', { month: 'short', day: 'numeric' }); } catch { return null; } } interface FlyerListProps { flyers: Flyer[]; onFlyerSelect: (flyer: Flyer) => void; selectedFlyerId: number | null; } export const FlyerList: React.FC = ({ flyers, onFlyerSelect, selectedFlyerId }) => { return (

Processed Flyers

{flyers.length > 0 ? ( ) : (

No flyers have been processed yet. Upload one to get started.

)}
); };