import { notFound } from 'next/navigation';

import { RoleGate } from '@/components/auth/RoleGate';
import { FeaturePreviewPage } from '@/components/preview/FeaturePreviewPage';

const sections = {
  deals: {
    title: 'Co-Sell Deals',
    description:
      'Manage partner-sourced opportunities and keep support ownership clear between Sankofa and partner teams.',
    bullets: [
      'Deal registration should identify whether the offer is native or partner-led.',
      'Commercial models like IRU and SaaS belong on the offer, not in the marketplace taxonomy.',
      'Pipeline updates should stay visible to both partner and internal teams.',
    ],
  },
  onboarding: {
    title: 'Technical Onboarding',
    description:
      'Track partner enablement, architecture review, and readiness steps before listing or co-selling.',
    bullets: [
      'Technical onboarding should align with fulfillment mode and support boundaries.',
      'Partners need a clear path for request-only and operator-provisioned programs.',
      'Documentation and enablement materials are part of this workspace, not ad hoc email threads.',
    ],
  },
  solutions: {
    title: 'Solution Registration',
    description:
      'Register partner solutions for downstream program listing and lifecycle review.',
    bullets: [
      'Listings should declare support owner, fulfillment mode, and commercial model.',
      'Submission does not imply instant publication or instant provisioning.',
      'Partner solutions should hand off cleanly into downstream program apps when required.',
    ],
  },
  resources: {
    title: 'Partner Resources',
    description:
      'Centralize partner-facing materials, enablement assets, and shared program guidance.',
    bullets: [
      'Keep marketplace copy, support expectations, and onboarding assets aligned.',
      'Differentiate native platform material from partner-program material.',
      'Use this space as the canonical partner enablement boundary.',
    ],
  },
} as const;

export default function PartnerSectionPage({
  params,
}: {
  params: { section: keyof typeof sections };
}) {
  const section = sections[params.section];
  if (!section) notFound();

  return (
    <RoleGate
      allowedRoles={['partner', 'admin', 'ADMIN']}
      callbackUrl={`/partner/${params.section}`}
      badge="Partner"
      title="Partner access required"
      subtitle="Sign in with a partner or internal-admin account to open this workspace."
    >
      <FeaturePreviewPage
        eyebrow="Partner Workspace"
        title={section.title}
        description={section.description}
        bullets={section.bullets}
        primaryAction={{ href: '/partner', label: 'Back to Partner Overview' }}
        secondaryAction={{ href: '/help/support', label: 'Contact Partner Support' }}
        status="request-only"
      />
    </RoleGate>
  );
}
