import type { ElementType, FC, HTMLAttributes } from 'react';
import classnames from 'classnames';
import React from 'react';

export interface DrawerProps extends HTMLAttributes<HTMLElement> {
  open?: boolean;
  tag?: ElementType;
}

const Drawer: FC<DrawerProps> = ({ className, open = false, tag: Tag = 'div', ...props }) => (
  <Tag className={classnames('drawer', { open }, className)} data-testid="Drawer" {...props} />
);

export default Drawer;
