import React from "react"

import { ModalHeadProps } from "../interface"
import { CloseIcon } from "./CloseIcon"
import "./index.css"

/**
 * ModalHead组件
 */
const ModalHead: React.FC<ModalHeadProps> = props => {
  const { title, onClose } = props

  return (
    <div className="nts-modal-head">
      <div className="nts-modal-title">{title}</div>
      <button className="nts-modal-close-button" onClick={onClose}>
        <CloseIcon />
      </button>
    </div>
  )
}

export default ModalHead
