'use client';

import type { Result } from '@/lib/contracts/Result';
import type { SponsorshipRequestsViewData } from '@/lib/view-data/SponsorshipRequestsViewData';
import { SponsorshipRequestsTemplate } from '@/templates/SponsorshipRequestsTemplate';

interface SponsorshipRequestsPageClientProps {
  viewData: SponsorshipRequestsViewData;
  onAccept: (requestId: string) => Promise<Result<void, string>>;
  onReject: (requestId: string, reason?: string) => Promise<Result<void, string>>;
}

export function SponsorshipRequestsPageClient({ viewData, onAccept, onReject }: SponsorshipRequestsPageClientProps) {
  return (
    <SponsorshipRequestsTemplate
      data={viewData.sections}
      onAccept={async (requestId) => {
        await onAccept(requestId);
      }}
      onReject={async (requestId, reason) => {
        await onReject(requestId, reason);
      }}
    />
  );
}
