import React from 'react' import { cn } from '../../../utils' import { ExpandedFooterContext, FooterConfigContext } from '../context' import { Category } from './Category' type Props = { disableScrollOnExpand?: boolean } export function ExpandedFooter({ disableScrollOnExpand }: Props) { const { expandedConfig } = React.useContext(FooterConfigContext) const { expanded } = React.useContext(ExpandedFooterContext) const ref = React.useRef(null) React.useEffect(() => { if (!disableScrollOnExpand && expanded) { ref.current?.scrollIntoView({ behavior: 'smooth' }) } }, [expanded]) return (
{Object.entries(expandedConfig).map(([label, items]) => ( ))}
) }