import { Dialog, DialogContent, DialogTitle } from '@mui/material'
import { CopyToClipboard } from './copyToClipboard'

interface CopyModalProps {
  open: boolean
  handleClose: () => void
  title: string
  textToCopy: string
}

export const CopyModal = ({
  open,
  handleClose,
  title,
  textToCopy
}: CopyModalProps) => {
  return (
    <Dialog open={open} onClose={handleClose} maxWidth="xs">
      <DialogTitle>{title}</DialogTitle>
      <DialogContent>
        <CopyToClipboard textToCopy={textToCopy} />
      </DialogContent>
    </Dialog>
  )
}

export default CopyModal
