import { getClassNames } from '@websolutespa/bom-core'; import { forwardRef, useContext } from 'react'; import styled from 'styled-components'; import { getVariantKey } from '../../variants'; import { UIStyledComponentProps } from '../types'; import { getCssResponsive } from '../utils'; import { DrawerContext } from './drawer.context'; import { IDrawerVariants, drawerVariants } from './drawer.variants'; const StyledBackdrop = styled.div ` ${props => getVariantKey('backdrop', props.variant, props.variants)} ${props => getCssResponsive(props)} `; export type DrawerBackdropProps = UIStyledComponentProps<{ className?: string; variant?: keyof typeof drawerVariants | (string & {}); variants?: IDrawerVariants; }>; export const DrawerBackdrop = forwardRef( function DrawerBackdrop({ className, variant, variants, ...props }, ref) { const classNames = getClassNames('drawer__backdrop', className); const context = useContext(DrawerContext); if (!context) { return; } return ( ); });