import { MapPin, Phone } from "lucide-react"; import { toPersianDigits } from "@/lib/format/persian-digits"; import type { StoreDetail } from "@/types/api"; /** Iranian week: 0=Saturday..6=Friday. JS Date#getDay(): 0=Sunday..6=Saturday. */ function todaysWorkingHours(store: StoreDetail) { const jsDay = new Date().getDay(); const iranianWeekday = (jsDay + 1) % 7; return store.working_hours.find((wh) => wh.weekday === iranianWeekday) ?? null; } function formatTime(value: string | null) { if (!value) return ""; return toPersianDigits(value.slice(0, 5)); } /** designspec.md §2.2 — hero-overlapping white info card. */ export function StoreInfoCard({ store }: { store: StoreDetail }) { const today = todaysWorkingHours(store); const mapsUrl = `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(`${store.name} ${store.address}`)}`; return (
{store.category.name}