'use client';

import React from 'react';
import { Stack } from '@/ui/Stack';
import { Heading } from '@/ui/Heading';
import { Box } from '@/ui/Box';
import type { SponsorshipRequestsViewData } from '@/lib/view-data/SponsorshipRequestsViewData';
import { SponsorshipRequestsPanel } from '@/components/profile/SponsorshipRequestsPanel';

export interface SponsorshipRequestsTemplateProps {
  viewData: SponsorshipRequestsViewData;
  onAccept: (requestId: string) => Promise<void>;
  onReject: (requestId: string, reason?: string) => Promise<void>;
  processingId?: string | null;
}

export function SponsorshipRequestsTemplate({
  viewData,
  onAccept,
  onReject,
  processingId,
}: SponsorshipRequestsTemplateProps) {
  return (
    <Stack gap={8}>
      <Box as="header">
        <Heading level={1}>Sponsorship Requests</Heading>
      </Box>

      <Box as="main">
        <SponsorshipRequestsPanel 
          sections={viewData.sections}
          onAccept={onAccept}
          onReject={onReject}
          processingId={processingId}
        />
      </Box>
    </Stack>
  );
}
