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

import React, { useMemo } from "react";
import { useEventWizardStorage } from "../../../../../services/Services";
import { EventStep4Component } from "../../../../../components/business/events";
import { BriefcaseIcon } from "@heroicons/react/24/outline";
import { EVENT_TYPE_CONFERENCE } from "../../../../../constants/Event";

// Conference event type configuration
const conferenceConfig = {
  eventType: EVENT_TYPE_CONFERENCE,
  labels: {
    wizardTitle: "Add New Conference",
    eventTypeName: "Conference",
    backToList: "Back to Conferences",
  },
  icons: {
    wizard: BriefcaseIcon,
  },
  routes: {
    list: "/admin/events/conferences",
    step1: "/admin/events/conferences/add/step-1",
    step2: "/admin/events/conferences/add/step-2",
    step3: "/admin/events/conferences/add/step-3",
    step4: "/admin/events/conferences/add/step-4",
  },
};

function AdminEventConferenceAddStep3Page() {
  const eventWizardStorage = useEventWizardStorage();

  // Wrapper for Conference storage to match the generic interface - memoized to prevent re-renders
  const wrappedStorage = useMemo(() => ({
    getWizardData: () => eventWizardStorage.getEventWizard(),
    saveWizardData: (data) => eventWizardStorage.saveEventWizard(data),
    clearWizardData: () => eventWizardStorage.clearEventWizard(),
  }), []);

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

export default AdminEventConferenceAddStep3Page;
