import { redirect } from "next/navigation";
import { getCurrentUser } from "@/lib/api";
import { getDict } from "@/lib/i18n";
import { Icon } from "@/components/Icon";

export const dynamic = "force-dynamic";

export default async function MessagesPage() {
  const user = await getCurrentUser();
  if (!user) redirect("/login");
  const t = await getDict();

  return (
    <div className="space-y-6">
      <h1 className="text-2xl font-extrabold text-slate-900">{t.common.messages}</h1>
      <div className="rounded-xl border border-slate-200 bg-white p-10 text-center shadow-card">
        <Icon name="mail" className="mx-auto h-10 w-10 text-slate-300" />
        <p className="mt-3 text-sm font-semibold text-slate-600">{t.common.noMessages}</p>
      </div>
    </div>
  );
}
