import React from 'react';
import DisclaimerModal, { DisclaimerSection } from './DisclaimerModal';
import { useDisclaimer } from '../hooks/useDisclaimer';

export interface DisclaimerProviderProps {
  id: string;
  title: string;
  disclaimerSections: DisclaimerSection[];
  theme?: 'dark' | 'light';
  storagePrefix?: string;
}

const DisclaimerProvider: React.FC<DisclaimerProviderProps> = ({
  id,
  title,
  disclaimerSections,
  theme = 'light',
  storagePrefix = 'disclaimer'
}) => {
  const { isOpen, onClose } = useDisclaimer(id, {
    storagePrefix,
    defaultOpen: true
  });

  return (
    <DisclaimerModal
      isOpen={isOpen}
      onClose={onClose}
      title={title}
      disclaimerSections={disclaimerSections}
      theme={theme}
    />
  );
};

export default DisclaimerProvider;
