import { useCallback } from 'react';
import { prependContext } from "../../../../utils/tracking/index.js";
import classes from './styles.module.scss';
const CloseButton = function CloseButton(props) {
  const {
    drawer,
    tracking
  } = props;
  const trackingContext = prependContext({
    prefix: tracking?.context,
    context: 'CloseButton'
  });
  const toggleAndTrack = useCallback(() => {
    drawer.toggle({
      context: trackingContext
    });
  }, [drawer, trackingContext]);
  return <button className={classes.button} title="Close drawer" onClick={toggleAndTrack} type="button" aria-label="Close drawer" />;
};
export default CloseButton;