import MonitoringPengiriman from "../../components/MonitoringPengiriman";

const getSekolahId = () => {
  return (
    localStorage.getItem("sekolah_id") ||
    localStorage.getItem("user_sekolah_id") ||
    localStorage.getItem("school_id") ||
    ""
  );
};

export default function SekolahPengiriman() {
  const sekolahId = getSekolahId();

  return (
    <div className="p-4 sm:p-6 lg:p-8 max-w-7xl mx-auto">
      {!sekolahId && (
        <div className="mb-5 rounded-2xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm font-semibold text-amber-700">
          ID sekolah belum ditemukan di localStorage. Pastikan akun Pihak Sekolah menyimpan sekolah_id.
        </div>
      )}

      <MonitoringPengiriman role="validator" sekolahId={sekolahId} />
    </div>
  );
}
