import type { Metadata } from "next";
import { getWebsiteContent } from "@/lib/erpnext";

export const metadata: Metadata = {
  title: "Termeni si Conditii",
};

export default async function TermsPage() {
  let content = "";
  try {
    const data = await getWebsiteContent("terms");
    content = data[0]?.content_ro || "";
  } catch {
    content = "<h1>Termeni si Conditii</h1><p>Continutul va fi disponibil in curand.</p>";
  }

  return (
    <section className="py-16">
      <div
        className="prose prose-teal mx-auto max-w-3xl px-4"
        dangerouslySetInnerHTML={{ __html: content }}
      />
    </section>
  );
}
