/**
 * Sample fixtures used by the design-system gallery sections.
 * Static data - no PII, no real users.
 */

import type { ReactNode } from 'react';
import { createElement } from 'react';
import type { DealCardDeal } from '@/components/ui/domain/DealCard';
import type { DealRowDeal } from '@/components/ui/domain/DealRow';
import type { BottomNavItem } from '@/components/ui/layout/BottomNav';
import { Icon } from '@/components/ui/icons/Icon';
import { SAMPLE_DEAL_AMBIENT_IMAGES } from '@/lib/deal-ambient';

const SAMPLE_IMAGE_URL = SAMPLE_DEAL_AMBIENT_IMAGES.warm;
const SAMPLE_IMAGE_URL_GROUP = SAMPLE_DEAL_AMBIENT_IMAGES.cool;
const SAMPLE_IMAGE_URL_VENDOR = SAMPLE_DEAL_AMBIENT_IMAGES.fresh;

// ─── Deal fixtures ──────────────────────────────────────────────────────────

const inOneHour = () => new Date(Date.now() + 60 * 60 * 1000).toISOString();
const inSixHours = () => new Date(Date.now() + 6 * 60 * 60 * 1000).toISOString();

export const SAMPLE_DEAL: DealCardDeal = {
  id: 'sample-1',
  title: 'ארוחת בורגר + שתייה',
  vendorName: 'מסעדת רוטשילד 22',
  city: 'תל אביב',
  originalPrice: 90,
  discountedPrice: 45,
  imageSrc: SAMPLE_IMAGE_URL,
  imageAlt: 'Burger meal',
  windowEnd: inOneHour(),
  stockRemaining: 6,
  stockTotal: 15,
  dealType: 'COUPON',
  discountPercent: 50,
  heSlug: 'sample-burger-deal',
};

export const SAMPLE_VENDOR_DEAL: DealCardDeal = {
  ...SAMPLE_DEAL,
  id: 'sample-vendor-1',
  imageSrc: SAMPLE_IMAGE_URL_VENDOR,
  windowEnd: inSixHours(),
};

export const SAMPLE_DEAL_GROUP: DealCardDeal = {
  id: 'sample-group',
  title: 'טיפול ספא זוגי שעה',
  vendorName: 'ספא שיין',
  city: 'הרצליה',
  originalPrice: 600,
  discountedPrice: 300,
  imageSrc: SAMPLE_IMAGE_URL_GROUP,
  imageAlt: 'Spa treatment',
  windowEnd: inSixHours(),
  stockRemaining: 3,
  stockTotal: 5,
  dealType: 'GROUP',
  discountPercent: 50,
  heSlug: 'sample-spa-deal',
};

// ─── Deal-row fixtures ──────────────────────────────────────────────────────

export const SAMPLE_DEAL_ROW_ACTIVE: DealRowDeal = {
  id: 'row-active',
  title: 'ארוחת בורגר + שתייה',
  vendorName: 'מסעדת רוטשילד 22',
  imageSrc: SAMPLE_IMAGE_URL,
  imageAlt: 'Burger',
  state: 'ACTIVE',
  stockRemaining: 6,
  stockTotal: 15,
  windowEnd: inSixHours(),
};

export const SAMPLE_DEAL_ROW_PENDING: DealRowDeal = {
  ...SAMPLE_DEAL_ROW_ACTIVE,
  id: 'row-pending',
  title: 'פסטה ים תיכונית',
  state: 'PENDING_APPROVAL',
};

export const SAMPLE_DEAL_ROW_REJECTED: DealRowDeal = {
  ...SAMPLE_DEAL_ROW_ACTIVE,
  id: 'row-rejected',
  state: 'REJECTED',
};

export const SAMPLE_DEAL_ROW_EXPIRED: DealRowDeal = {
  ...SAMPLE_DEAL_ROW_ACTIVE,
  id: 'row-expired',
  state: 'EXPIRED',
};

export const SAMPLE_DEAL_ROW_SOLD_OUT: DealRowDeal = {
  ...SAMPLE_DEAL_ROW_ACTIVE,
  id: 'row-sold',
  state: 'SOLD_OUT',
  stockRemaining: 0,
};

// ─── BottomNav items ────────────────────────────────────────────────────────

const navIcon = (
  name: 'Search' | 'ShoppingBag' | 'User' | 'Settings' | 'Bookmark' | 'Bell' | 'MapPin',
): ReactNode => createElement(Icon, { name, size: 'sm' });

export const CUSTOMER_NAV_ITEMS: BottomNavItem[] = [
  { href: '#', icon: navIcon('MapPin'), label: 'בית', active: true },
  { href: '#', icon: navIcon('Search'), label: 'חיפוש' },
  { href: '#', icon: navIcon('ShoppingBag'), label: 'רכישות' },
  { href: '#', icon: navIcon('User'), label: 'פרופיל' },
];

export const VENDOR_NAV_ITEMS: BottomNavItem[] = [
  { href: '#', icon: navIcon('MapPin'), label: 'דשבורד', active: true },
  { href: '#', icon: navIcon('Bookmark'), label: 'דילים' },
  { href: '#', icon: navIcon('Bell'), label: 'התראות' },
  { href: '#', icon: navIcon('Settings'), label: 'הגדרות' },
];
