import * as Ariakit from '@ariakit/react'; import { IconX } from '@websolutespa/bom-mixer-icons'; import styled from 'styled-components'; import { Button } from '../button/button'; import { getClassNames } from '@websolutespa/bom-core'; import { useLabel } from '@websolutespa/bom-mixer-hooks'; import { ReactElement, ReactNode, useContext } from 'react'; import { getVariantKey } from '../../variants'; import { getCssResponsive } from '../utils'; import { DrawerContext } from './drawer.context'; import { IDrawerVariants, drawerVariants } from './drawer.variants'; const DrawerHeaderStyle = styled.div` ${props => getVariantKey('header', props.variant, props.variants)} ${props => getCssResponsive(props)} `; export type DrawerHeaderProps = { className?: string; variant?: keyof typeof drawerVariants | (string & {}); variants?: IDrawerVariants; children?: ReactNode; close?: ReactElement; }; export const DrawerHeader = ({ children, close, className, variant, variants, ...props }: DrawerHeaderProps) => { const label = useLabel(); const classNames = getClassNames('drawer__header', className); const context = useContext(DrawerContext); if (!context) { return; } return ( {children} )} /> ); }; DrawerHeader.displayName = 'DrawerHeader';