/** Extracted from crm-html/index.html — testimonial-sec. */

export interface TestimonialSectionIntro {
  subTitle: string;
  title: string;
}

export interface TestimonialSlide {
  id: number;
  quote: string;
  authorName: string;
  authorRole: string;
  thumbSrc: string;
  thumbAlt: string;
}

export interface TestimonialTab {
  id: string;
  label: string;
  panelId: string;
  slides: TestimonialSlide[];
}

export interface HomeTestimonialsContent {
  intro: TestimonialSectionIntro;
  tabs: TestimonialTab[];
}

const thumbBases = [
  {
    thumbSrc: "/assets/images/event/thumb1-1.png",
    thumbAlt: "Client thumbnail 1",
  },
  {
    thumbSrc: "/assets/images/event/thumb1-2.png",
    thumbAlt: "Client thumbnail 2",
  },
  {
    thumbSrc: "/assets/images/event/thumb1-3.png",
    thumbAlt: "Client thumbnail 3",
  },
  {
    thumbSrc: "/assets/images/event/thumb1-4.png",
    thumbAlt: "Client thumbnail 4",
  },
  {
    thumbSrc: "/assets/images/event/thumb1-5.png",
    thumbAlt: "Client thumbnail 5",
  },
] as const;

/** Rotates which avatar image pairs with each slide index so tabs look visually distinct. */
function buildSlides(
  rows: {
    quote: string;
    authorName: string;
    authorRole: string;
  }[],
  thumbRotation = 0,
): TestimonialSlide[] {
  const n = thumbBases.length;
  return rows.map((row, i) => ({
    id: i + 1,
    ...thumbBases[(i + thumbRotation) % n]!,
    ...row,
  }));
}

const tab1Slides = buildSlides([
  {
    quote:
      '"They shipped our CRM rollout on time across twelve teams—clear process, zero drama."',
    authorName: "William C. Irvin,",
    authorRole: "CO-Founder",
  },
  {
    quote:
      '"We went from spreadsheets to one pipeline; the team actually uses it every day."',
    authorName: "Sarah M. Chen,",
    authorRole: "Head of Sales",
  },
  {
    quote:
      '"Onboarding was fast. Support answered the few edge cases we hit within hours."',
    authorName: "James Okonkwo,",
    authorRole: "Operations Lead",
  },
  {
    quote:
      '"Reporting finally matches what leadership asks for—we close the books with confidence."',
    authorName: "Elena Rossi,",
    authorRole: "Finance Director",
  },
  {
    quote:
      '"Our project count keeps growing; the platform has stayed stable as we scale."',
    authorName: "Marcus Webb,",
    authorRole: "VP Delivery",
  },
], 0);

const tab2Slides = buildSlides([
  {
    quote:
      '"Our EMEA and APAC offices share one customer view—no more duplicate records."',
    authorName: "Amélie Durand,",
    authorRole: "Global CX Lead",
  },
  {
    quote:
      '"Localization and time zones just work. Handoffs between regions are finally smooth."',
    authorName: "Hiro Tanaka,",
    authorRole: "Regional Manager",
  },
  {
    quote:
      '"We onboard partners worldwide with the same playbook; training time dropped a lot."',
    authorName: "Priya Nair,",
    authorRole: "Partnerships",
  },
  {
    quote:
      '"Compliance reviews in two countries were easier because audit trails are built in."',
    authorName: "Lars Bergström,",
    authorRole: "IT Security",
  },
  {
    quote:
      '"Clients in different languages see consistent branding and data—it feels cohesive."',
    authorName: "Camila Ortiz,",
    authorRole: "Brand Director",
  },
], 2);

const tab3Slides = buildSlides([
  {
    quote:
      '"Our NPS jumped after we unified follow-ups—customers notice the faster responses."',
    authorName: "Daniel Foster,",
    authorRole: "Customer Success",
  },
  {
    quote:
      '"Negative feedback now turns into tickets we can track; nothing falls through cracks."',
    authorName: "Rachel Kim,",
    authorRole: "Support Manager",
  },
  {
    quote:
      '"We read reviews in one dashboard and act on themes—product decisions got sharper."',
    authorName: "Omar Haddad,",
    authorRole: "Product Lead",
  },
  {
    quote:
      '"Surveys tie straight to accounts so we know who to thank and who needs help."',
    authorName: "Nina Volkov,",
    authorRole: "RevOps",
  },
  {
    quote:
      '"The team trusts the numbers now; we celebrate wins with data everyone agrees on."',
    authorName: "Tom Bradley,",
    authorRole: "CEO",
  },
], 4);

export const homeTestimonialsContent: HomeTestimonialsContent = {
  intro: {
    subTitle: "Global Clients Feedback",
    title: "Hear from Our Worldwide Happy Customers",
  },
  tabs: [
    {
      id: "nav-home",
      label: "10k+ Projects Complate",
      panelId: "nav-home",
      slides: tab1Slides,
    },
    {
      id: "nav-profile",
      label: "1.8 million global clients",
      panelId: "nav-profile",
      slides: tab2Slides,
    },
    {
      id: "nav-contact",
      label: "99% Positive reviews",
      panelId: "nav-contact",
      slides: tab3Slides,
    },
  ],
};
