import React, { useMemo, memo } from "react";
import { useCertificationManager } from "../../../../../services/Services";
import { SettingsDeleteView } from "../../../../../components/business/views";
import { UIXThemeProvider } from "../../../../../components/UIX";
import { ClipboardDocumentCheckIcon, AcademicCapIcon, DocumentTextIcon, UserGroupIcon } from "@heroicons/react/24/outline";

// Static configuration outside component
const IMPACT_WARNINGS = [
  {
    icon: UserGroupIcon,
    text: "Facilitators who have this certification will lose this qualification record"
  },
  {
    icon: DocumentTextIcon,
    text: "Historical records and reports that reference this certification"
  },
  {
    icon: AcademicCapIcon,
    text: "Future certification assignments will not have access to this option"
  }
];

const ALTERNATIVE_TEXT = "Consider marking the certification as inactive instead of deleting it to preserve historical records and allow for potential reactivation in the future.";

function SettingCertificationDeletePage() {
  return (
    <UIXThemeProvider>
      <SettingCertificationDeletePageContent />
    </UIXThemeProvider>
  );
}

const SettingCertificationDeletePageContent = memo(function SettingCertificationDeletePageContent() {
  const certificationManager = useCertificationManager();

  // Memoize props (static but keeping pattern consistent)
  const impactWarnings = useMemo(() => IMPACT_WARNINGS, []);
  const alternativeText = useMemo(() => ALTERNATIVE_TEXT, []);

  return (
    <SettingsDeleteView
      entityType="certification"
      entityTypePlural="Certifications"
      entityIcon={ClipboardDocumentCheckIcon}
      entityManager={certificationManager}
      basePath="/admin/settings/certification"
      listPath="/admin/settings/certification"
      title="Delete Certification"
      subtitle="Permanent deletion confirmation"
      impactWarnings={impactWarnings}
      alternativeText={alternativeText}
      requiresConfirmation={true}
    />
  );
});
SettingCertificationDeletePageContent.displayName = 'SettingCertificationDeletePageContent';

export default SettingCertificationDeletePage;