import React from 'react';
import PropTypes from 'prop-types';

import { DialogTitle, Stack } from '@/mui/components';

import styles from './Title.module.scss';

function Title({ children, onClose = null }) {
  return (
    <DialogTitle component={Stack} direction="row" className={styles.DialogTitle} onClose={onClose}>
      {children}
    </DialogTitle>
  );
}

Title.propTypes = {
  children: PropTypes.node.isRequired,
  onClose: PropTypes.func,
};

export default Title;
