// File Path: monorepo/web/frontend/src/pages/Admin/Event/InSchool/Add/Step3Page.jsx

import React from "react";
import { useOnsiteEventWizardStorage } from "../../../../../services/Services";
import { EventStep4Component } from "../../../../../components/business/events";
import { HomeIcon } from "@heroicons/react/24/outline";
import { EVENT_TYPE_ONSITE } from "../../../../../constants/Event";

// Onsite event type configuration
const onsiteConfig = {
  eventType: EVENT_TYPE_ONSITE,
  labels: {
    wizardTitle: "Add New Onsite Event",
    eventTypeName: "Onsite Event",
    backToList: "Back to Onsite Events",
  },
  icons: {
    wizard: HomeIcon,
  },
  routes: {
    list: "/admin/events/in-schools",
    step1: "/admin/events/in-schools/add/step-1",
    step2: "/admin/events/in-schools/add/step-2",
    step3: "/admin/events/in-schools/add/step-3",
    step4: "/admin/events/in-schools/add/step-4",
  },
};

// Wrapper for Onsite storage to match the generic interface
const createOnsiteStorageWrapper = (onsiteEventWizardStorage) => ({
  getWizardData: () => onsiteEventWizardStorage.getOnsiteEventWizard(),
  saveWizardData: (data) =>
    onsiteEventWizardStorage.saveOnsiteEventWizard(data),
  clearWizardData: () => onsiteEventWizardStorage.clearOnsiteEventWizard(),
});

function AdminEventInSchoolAddStep4Page() {
  const onsiteEventWizardStorage = useOnsiteEventWizardStorage();
  const wrappedStorage = createOnsiteStorageWrapper(onsiteEventWizardStorage);

  return (
    <EventStep4Component
      wizardStorage={wrappedStorage}
      eventTypeConfig={onsiteConfig}
    />
  );
}

export default AdminEventInSchoolAddStep4Page;
