import classnames from 'classnames';
import typography from '../typography.module.scss';
import { ResultsTableFormatContext, useFormatOptions } from '../context';
import classes from './styles.module.scss';
const ResultsContext = function ResultsContext(props) {
  const {
    children,
    className,
    format = 'standard',
    expandable,
    expandableCutoff,
    disableFooter,
    id
  } = props;
  const [ref, formatOptions] = useFormatOptions({
    format,
    expandable,
    expandableCutoff,
    disableFooter,
    id
  });
  const {
    size
  } = formatOptions;
  return <ResultsTableFormatContext.Provider value={formatOptions}>
      <div ref={ref} className={classnames(className, classes.container, classes[size], classes[format], typography[size])}>
        {children}
      </div>
    </ResultsTableFormatContext.Provider>;
};
export default ResultsContext;