import type { ReactNode } from 'react';

export type TFn = (key: string, fallback?: string, vars?: Record<string, string | number>) => string;

export interface IntegrationItem {
  name: string;
  category: 'pos' | 'delivery' | 'telephony' | 'messaging' | 'payments' | 'analytics';
  color: string;
  initials: string;
  /** Wordmark text rendered inside the brand chip (always lowercase brand name). */
  wordmark: string;
  /** Optional italic styling for brands with iconic italic logos (Stripe, Toast). */
  italic?: boolean;
  /** Short one-liner explaining what this integration unlocks for the restaurant. */
  description: string;
  /** Path to the brand wordmark SVG asset under /public/marketing/logos. */
  logoSrc: string;
  /** Accessible alt text for the brand logo asset. */
  logoAlt: string;
}

/** Used by: (landing)/integrations/page.tsx */
export const getIntegrations = (t: TFn): IntegrationItem[] => [
  { name: t('landing.int.toast', 'Toast POS'), category: 'pos', color: '#FF4C00', initials: 'TO', wordmark: 'toast', italic: true,
    description: t('landing.int.toastDesc', 'Two-way menu & order sync with Toast tickets.'),
    logoSrc: '/marketing/logos/toast.svg', logoAlt: 'Toast POS logo' },
  { name: t('landing.int.square', 'Square'), category: 'pos', color: '#3E4348', initials: 'SQ', wordmark: 'Square',
    description: t('landing.int.squareDesc', 'Push AI orders straight to your Square POS.'),
    logoSrc: '/marketing/logos/square.svg', logoAlt: 'Square logo' },
  { name: t('landing.int.clover', 'Clover'), category: 'pos', color: '#00A651', initials: 'CL', wordmark: 'Clover',
    description: t('landing.int.cloverDesc', 'Live menu sync and order routing for Clover.'),
    logoSrc: '/marketing/logos/clover.svg', logoAlt: 'Clover logo' },
  { name: t('landing.int.lightspeed', 'Lightspeed'), category: 'pos', color: '#FF6B35', initials: 'LS', wordmark: 'lightspd',
    description: t('landing.int.lightspeedDesc', 'Lightspeed Restaurant menu, modifiers & tabs.'),
    logoSrc: '/marketing/logos/lightspeed.svg', logoAlt: 'Lightspeed logo' },
  { name: t('landing.int.uberEats', 'Uber Eats'), category: 'delivery', color: '#06C167', initials: 'UE', wordmark: 'Uber Eats',
    description: t('landing.int.uberEatsDesc', 'Auto-accept and sync Uber Eats orders.'),
    logoSrc: '/marketing/logos/uber-eats.svg', logoAlt: 'Uber Eats logo' },
  { name: t('landing.int.doordash', 'DoorDash'), category: 'delivery', color: '#FF3008', initials: 'DD', wordmark: 'DoorDash',
    description: t('landing.int.doordashDesc', 'Unified DoorDash orders in one inbox.'),
    logoSrc: '/marketing/logos/doordash.svg', logoAlt: 'DoorDash logo' },
  { name: t('landing.int.grubhub', 'Grubhub'), category: 'delivery', color: '#F63440', initials: 'GH', wordmark: 'Grubhub',
    description: t('landing.int.grubhubDesc', 'Grubhub menu publishing and order intake.'),
    logoSrc: '/marketing/logos/grubhub.svg', logoAlt: 'Grubhub logo' },
  { name: t('landing.int.deliveroo', 'Deliveroo'), category: 'delivery', color: '#00CCBC', initials: 'DR', wordmark: 'deliveroo',
    description: t('landing.int.deliverooDesc', 'Deliveroo dispatch & menu sync (UK/EU).'),
    logoSrc: '/marketing/logos/deliveroo.svg', logoAlt: 'Deliveroo logo' },
  { name: t('landing.int.twilio', 'Twilio'), category: 'telephony', color: '#F22F46', initials: 'TW', wordmark: 'twilio',
    description: t('landing.int.twilioDesc', 'Bring your own Twilio number for AI calls.'),
    logoSrc: '/marketing/logos/twilio.svg', logoAlt: 'Twilio logo' },
  { name: t('landing.int.vonage', 'Vonage'), category: 'telephony', color: '#871FFF', initials: 'VG', wordmark: 'Vonage',
    description: t('landing.int.vonageDesc', 'Vonage SIP routing for inbound voice agents.'),
    logoSrc: '/marketing/logos/vonage.svg', logoAlt: 'Vonage logo' },
  { name: t('landing.int.whatsapp', 'WhatsApp'), category: 'messaging', color: '#25D366', initials: 'WA', wordmark: 'WhatsApp',
    description: t('landing.int.whatsappDesc', 'Official WhatsApp Business API messaging.'),
    logoSrc: '/marketing/logos/whatsapp.svg', logoAlt: 'WhatsApp logo' },
  { name: t('landing.int.messenger', 'Messenger'), category: 'messaging', color: '#0084FF', initials: 'FB', wordmark: 'Messenger',
    description: t('landing.int.messengerDesc', 'Reply to Facebook Messenger DMs with AI.'),
    logoSrc: '/marketing/logos/messenger.svg', logoAlt: 'Messenger logo' },
  { name: t('landing.int.stripe', 'Stripe'), category: 'payments', color: '#635BFF', initials: 'ST', wordmark: 'stripe', italic: true,
    description: t('landing.int.stripeDesc', 'Take deposits and pre-orders via Stripe links.'),
    logoSrc: '/marketing/logos/stripe.svg', logoAlt: 'Stripe logo' },
  { name: t('landing.int.paypal', 'PayPal'), category: 'payments', color: '#003087', initials: 'PP', wordmark: 'PayPal', italic: true,
    description: t('landing.int.paypalDesc', 'PayPal checkout for online & phone orders.'),
    logoSrc: '/marketing/logos/paypal.svg', logoAlt: 'PayPal logo' },
  { name: t('landing.int.opentable', 'OpenTable'), category: 'analytics', color: '#DA3743', initials: 'OT', wordmark: 'OpenTable',
    description: t('landing.int.opentableDesc', 'OpenTable bookings synced to AI confirmations.'),
    logoSrc: '/marketing/logos/opentable.svg', logoAlt: 'OpenTable logo' },
  { name: t('landing.int.resy', 'Resy'), category: 'analytics', color: '#1A1A1A', initials: 'RS', wordmark: 'resy',
    description: t('landing.int.resyDesc', 'Resy reservations with smart reminders.'),
    logoSrc: '/marketing/logos/resy.svg', logoAlt: 'Resy logo' },
];

export interface CategoryDef {
  key: IntegrationItem['category'];
  label: string;
}

/** Used by: (landing)/integrations/page.tsx */
export const getIntegrationCategories = (t: TFn): CategoryDef[] => [
  { key: 'pos', label: t('landing.int.catPos', 'Point of Sale') },
  { key: 'delivery', label: t('landing.int.catDelivery', 'Delivery') },
  { key: 'telephony', label: t('landing.int.catTelephony', 'Telephony') },
  { key: 'messaging', label: t('landing.int.catMessaging', 'Messaging') },
  { key: 'payments', label: t('landing.int.catPayments', 'Payments') },
  { key: 'analytics', label: t('landing.int.catAnalytics', 'Reservations') },
];

export interface CustomerLogo {
  name: string;
  initials: string;
  color: string;
  /** Path to the customer wordmark SVG asset under /public/marketing/logos. */
  logoSrc: string;
  /** Accessible alt text for the customer logo asset. */
  logoAlt: string;
}

/** Used by: (landing)/_HomePageContent.tsx */
export const getCustomerLogos = (t: TFn): CustomerLogo[] => [
  { name: t('landing.logos.bella', 'Bella Napoli'), initials: 'BN', color: 'from-orange-500 to-orange-700',
    logoSrc: '/marketing/logos/bella-napoli.svg', logoAlt: 'Bella Napoli logo' },
  { name: t('landing.logos.spice', 'Spice Garden'), initials: 'SG', color: 'from-teal-500 to-teal-700',
    logoSrc: '/marketing/logos/spice-garden.svg', logoAlt: 'Spice Garden logo' },
  { name: t('landing.logos.dragon', 'Dragon Palace'), initials: 'DP', color: 'from-blue-500 to-blue-700',
    logoSrc: '/marketing/logos/dragon-palace.svg', logoAlt: 'Dragon Palace logo' },
  { name: t('landing.logos.casa', 'Casa Mia'), initials: 'CM', color: 'from-emerald-500 to-emerald-700',
    logoSrc: '/marketing/logos/casa-mia.svg', logoAlt: 'Casa Mia logo' },
  { name: t('landing.logos.sakura', 'Sakura Sushi'), initials: 'SS', color: 'from-rose-500 to-rose-700',
    logoSrc: '/marketing/logos/sakura-sushi.svg', logoAlt: 'Sakura Sushi logo' },
  { name: t('landing.logos.olive', 'Olive & Vine'), initials: 'OV', color: 'from-amber-500 to-amber-700',
    logoSrc: '/marketing/logos/olive-vine.svg', logoAlt: 'Olive & Vine logo' },
  { name: t('landing.logos.harbor', 'Harbor Grill'), initials: 'HG', color: 'from-indigo-500 to-indigo-700',
    logoSrc: '/marketing/logos/harbor-grill.svg', logoAlt: 'Harbor Grill logo' },
  { name: t('landing.logos.taco', 'Taco Libre'), initials: 'TL', color: 'from-violet-500 to-violet-700',
    logoSrc: '/marketing/logos/taco-libre.svg', logoAlt: 'Taco Libre logo' },
];

export interface CompareRow {
  feature: string;
  ra: string | true;
  legacy: string | false;
  generic: string | false;
}

/** Used by: (landing)/_HomePageContent.tsx */
export const getCompareRows = (t: TFn): CompareRow[] => [
  {
    feature: t('landing.cmp.row1', 'AI voice agent (multilingual)'),
    ra: true, legacy: false, generic: t('landing.cmp.row1g', 'English only'),
  },
  {
    feature: t('landing.cmp.row2', 'Unified chat + voice + WhatsApp'),
    ra: true, legacy: t('landing.cmp.row2l', 'Phone only'), generic: false,
  },
  {
    feature: t('landing.cmp.row3', 'Native POS integrations'),
    ra: t('landing.cmp.row3r', '50+ POS systems'), legacy: t('landing.cmp.row3l', 'Manual entry'), generic: false,
  },
  {
    feature: t('landing.cmp.row4', 'Real-time menu sync'),
    ra: true, legacy: false, generic: false,
  },
  {
    feature: t('landing.cmp.row5', 'Multi-branch dashboard'),
    ra: true, legacy: false, generic: t('landing.cmp.row5g', 'Add-on fee'),
  },
  {
    feature: t('landing.cmp.row6', 'Setup time'),
    ra: t('landing.cmp.row6r', 'Under 2 hours'), legacy: t('landing.cmp.row6l', '2–4 weeks'), generic: t('landing.cmp.row6g', '1 week'),
  },
  {
    feature: t('landing.cmp.row7', 'Per-call pricing'),
    ra: t('landing.cmp.row7r', 'Flat monthly'), legacy: t('landing.cmp.row7l', '$0.45/call'), generic: t('landing.cmp.row7g', '$0.20/min'),
  },
  {
    feature: t('landing.cmp.row8', 'White-label & self-host'),
    ra: true, legacy: false, generic: false,
  },
  {
    feature: t('landing.cmp.row9', 'QR storefront (scan-to-order)'),
    ra: true, legacy: false, generic: false,
  },
  {
    feature: t('landing.cmp.row10', 'Loyalty, coupons & gift cards'),
    ra: true, legacy: false, generic: t('landing.cmp.row10g', 'Third-party only'),
  },
  {
    feature: t('landing.cmp.row11', 'Built-in marketing campaigns'),
    ra: true, legacy: false, generic: false,
  },
];

export interface SecurityBadge {
  label: string;
  sub: string;
}

/** Used by: (landing)/security/page.tsx */
export const getSecurityBadges = (t: TFn): SecurityBadge[] => [
  { label: t('landing.sec.soc2', 'SOC 2 Type II'), sub: t('landing.sec.soc2Sub', 'Audited annually') },
  { label: t('landing.sec.gdpr', 'GDPR Ready'), sub: t('landing.sec.gdprSub', 'EU data residency') },
  { label: t('landing.sec.pci', 'PCI DSS'), sub: t('landing.sec.pciSub', 'Stripe-backed payments') },
  { label: t('landing.sec.aes', 'AES-256'), sub: t('landing.sec.aesSub', 'Encryption at rest') },
  { label: t('landing.sec.tls', 'TLS 1.3'), sub: t('landing.sec.tlsSub', 'Encryption in transit') },
  { label: t('landing.sec.uptime', '99.9% Uptime'), sub: t('landing.sec.uptimeSub', 'SLA-backed') },
];
