'use client';

import React, { useState } from 'react';
import { LeagueRulebookTemplate } from '@/templates/LeagueRulebookTemplate';
import { type RulebookSection } from '@/components/leagues/RulebookTabs';
import type { LeagueRulebookViewData } from '@/lib/view-data/LeagueRulebookViewData';
import { ClientWrapperProps } from '@/lib/contracts/components/ComponentContracts';

export function LeagueRulebookPageClient({ viewData }: ClientWrapperProps<LeagueRulebookViewData>) {
  const [activeSection, setActiveSection] = useState<RulebookSection>('scoring');

  return (
    <LeagueRulebookTemplate
      viewData={viewData}
      activeSection={activeSection}
      onSectionChange={setActiveSection}
    />
  );
}
