'use client';

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

interface SponsorshipRequestsPageClientProps extends ClientWrapperProps<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
      viewData={viewData}
      onAccept={async (requestId) => {
        await onAccept(requestId);
      }}
      onReject={async (requestId, reason) => {
        await onReject(requestId, reason);
      }}
    />
  );
}
