import type { Metadata } from 'next';
import { social } from '@/lib/metadata';
import { AboutContent, type AboutData } from './about-content';
import { getDoc, fig } from '@/lib/sanity';

export const metadata: Metadata = {
  title: 'About UEF',
  description:
    'A premier Chamber of Commerce dedicated to the economic, educational, and social transformation of the community since 1979.',
  ...social("About UEF", "A premier Chamber of Commerce dedicated to the economic, educational, and social transformation of the community since 1979.", "/about"),
};

export const revalidate = 60;

const QUERY = `*[_id == "aboutPage"][0]{
  heroEyebrow, heroTitle, heroSubtitle,
  visionHeading, visionText, missionHeading, missionItems,
  leadershipHeading, leadershipSubtitle,
  founder{ name, role, paragraphs, ${fig("photo")} },
  president{ name, role, quote, paragraphs, ${fig("photo")} },
  directorsHeading, directorsSubtitle,
  directors[]{ name, role, desc, linkedin, ${fig("img")} },
  gemHeading, gemTagline, gemIntro, gemPrinciples[]{ title, desc }, gemClosing, gemReels,
  objectivesHeading, objectives,
  ${fig("logoSymbol")}
}`;

export default async function About() {
  const data = await getDoc<AboutData>(QUERY);
  return <AboutContent data={data} />;
}
