import { createFileRoute } from "@tanstack/react-router";
import { useLang } from "@/lib/i18n";
import { Notice, PageHeader } from "@/components/site/Layout";
import { meta } from "@/lib/meta";
import { PRINCIPLES } from "@/lib/fields";

export const Route = createFileRoute("/eligibility")({
  head: () => meta("Eligibility & Selection", "Eligibility, nomination guidelines and the non-competitive selection principles."),
  component: Eligibility,
});

const SECTIONS = [
  { h: { si: "සුදුසුකම්", en: "Eligibility" }, items: [
    { si: "නාමයෝජිතයා වයස අවුරුදු 60 හෝ ඊට වැඩි ශ්‍රී ලාංකිකයෙකු විය යුතුය.", en: "The nominee should be a Sri Lankan aged 60 or above." },
    { si: "දිගු කාලීන, නිස්වාර්ථ සමාජ සේවයක් තිබිය යුතුය.", en: "They should have a long record of selfless service to society." },
  ]},
  { h: { si: "නාමයෝජනා මාර්ගෝපදේශ", en: "Nomination guidelines" }, items: [
    { si: "ඕනෑම අයෙකුට තවත් අයෙකු නාමයෝජනා කළ හැක.", en: "Anyone may nominate another person." },
    { si: "නාමයෝජිතයාගේ කැමැත්ත සහ පෞද්ගලිකත්වය ගෞරව කළ යුතුය.", en: "The nominee's consent and privacy must be respected." },
  ]},
  { h: { si: "සාක්ෂි අවශ්‍යතා", en: "Evidence requirements" }, items: [
    { si: "සේවය පිළිබඳ ලිපි, ඡායාරූප හෝ ප්‍රජා සාක්ෂි ඉදිරිපත් කළ හැක.", en: "Letters, photographs or community testimony may be submitted." },
  ]},
  { h: { si: "ඇගයීමේ මූලධර්ම", en: "Evaluation principles" }, items: [
    { si: "සියලුම ක්ෂේත්‍රවල සම්මාන සඳහා ඉදිරිපත් වන පුද්ගලයන්ගේ සේවය මූලධර්ම අනුව ඇගයීමට ලක් කෙරේ. එක් එක් ක්ෂේත්‍රයේ ස්වභාවය, සේවය කළ පරිසරය සහ පුද්ගලයාට තිබූ අවස්ථා හා සම්පත් සැලකිල්ලට ගනිමින් මෙම මූලධර්ම යොදාගත යුතුය.", en: "The service of every person nominated for honours is evaluated against these principles, applied with consideration of the nature of each field, the environment of the service, and the opportunities and resources available to the person." },
    { si: "ශ්‍රේණිගත කිරීමක් නැත — තෝරාගත් සියලු දෙනා සමානව ගෞරවයට පාත්‍ර වේ.", en: "There is no ranking — all selected honorees are honoured equally." },
    ...PRINCIPLES.map((p) => ({ si: `${p.h.si}: ${p.p.si}`, en: `${p.h.en}: ${p.p.en}` })),
  ]},
];

function Eligibility() {
  const { t } = useLang();
  return (
    <>
      <PageHeader eyebrow={{ si: "සුදුසුකම් සහ තේරීම", en: "Eligibility & selection" }} title={{ si: "තේරීමේ ක්‍රමවේදය", en: "How honorees are selected" }} />
      <div className="mx-auto max-w-3xl px-5 py-16">
        <Notice>{t({ si: "කෙටුම්පත — මෙම නීති සංවිධායකයින් විසින් නිල වශයෙන් අනුමත කරන තෙක් කෙටුම්පතක් ලෙස සලකන්න.", en: "DRAFT — these rules are proposed and pending official approval by the organizer." })}</Notice>
        <div className="mt-14 space-y-14">
          {SECTIONS.map((s, i) => (
            <section key={i}>
              <h2 className="text-3xl text-gold">{t(s.h)}</h2>
              <ul className="mt-5 space-y-3">
                {s.items.map((it, j) => (
                  <li key={j} className="flex gap-4 text-lg text-muted-foreground"><span className="mt-3 h-1.5 w-1.5 shrink-0 rotate-45 bg-gold" />{t(it)}</li>
                ))}
              </ul>
            </section>
          ))}
        </div>
      </div>
    </>
  );
}
