/*
 * Design reminder: Practical Navy + Mint Editorial. This location-page trust block uses
 * navy surfaces, mint proof cues, and calm disclosure copy. Never fabricate quotes,
 * names, ratings, outcomes, or customer identity.
 */

import { BadgeCheck, Quote } from "lucide-react";

type ApprovedLocationTestimonial = {
  quote: string;
  firstName: string;
  locationLabel: string;
  stateSlug: string;
  countySlug?: string;
};

// Add records only after the homeowner has approved publication and the location details.
const approvedLocationTestimonials: ApprovedLocationTestimonial[] = [];

export default function LocationTestimonials({ locationLabel, stateSlug, countySlug }: { locationLabel: string; stateSlug: string; countySlug?: string }) {
  const testimonials = approvedLocationTestimonials.filter((item) => item.stateSlug === stateSlug && (!item.countySlug || item.countySlug === countySlug));

  return (
    <section className="location-testimonials" aria-labelledby="location-testimonials-title">
      <div className="shell location-testimonials__inner">
        <div className="location-testimonials__heading">
          <span className="eyebrow eyebrow--line">HOMEOWNER FEEDBACK</span>
          <h2 id="location-testimonials-title">Stories from homeowners in and around {locationLabel}.</h2>
          <p>Direct-sale experiences are published only when a homeowner has approved the wording and location details.</p>
        </div>
        {testimonials.length > 0 ? (
          <div className="location-testimonials__grid">
            {testimonials.map((testimonial) => <figure className="location-testimonial" key={`${testimonial.firstName}-${testimonial.locationLabel}`}><Quote size={22} aria-hidden="true" /><blockquote>“{testimonial.quote}”</blockquote><figcaption><strong>{testimonial.firstName}</strong><span>{testimonial.locationLabel}</span></figcaption></figure>)}
          </div>
        ) : (
          <div className="location-testimonials__empty"><BadgeCheck size={22} aria-hidden="true" /><div><strong>Approved homeowner feedback belongs here.</strong><p>We do not use placeholder quotes, ratings, or unverified seller claims. Once a homeowner has provided permission, their approved story can be added to this local page.</p></div></div>
        )}
      </div>
    </section>
  );
}
