mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-05 16:16:01 -05:00
a074054cc9
GitOrigin-RevId: e4bea140d872ac3f8b2aca7833e658af684a1438
38 lines
956 B
TypeScript
38 lines
956 B
TypeScript
import { useTranslation } from 'react-i18next'
|
|
import { Modal } from 'react-bootstrap'
|
|
import AccessibleModal from '@/shared/components/accessible-modal'
|
|
import { memo } from 'react'
|
|
|
|
export type GenericMessageModalOwnProps = {
|
|
title: string
|
|
message: string
|
|
}
|
|
|
|
type GenericMessageModalProps = React.ComponentProps<typeof AccessibleModal> &
|
|
GenericMessageModalOwnProps
|
|
|
|
function GenericMessageModal({
|
|
title,
|
|
message,
|
|
...modalProps
|
|
}: GenericMessageModalProps) {
|
|
const { t } = useTranslation()
|
|
|
|
return (
|
|
<AccessibleModal {...modalProps}>
|
|
<Modal.Header closeButton>
|
|
<Modal.Title>{title}</Modal.Title>
|
|
</Modal.Header>
|
|
|
|
<Modal.Body className="modal-body-share">{message}</Modal.Body>
|
|
|
|
<Modal.Footer>
|
|
<button className="btn btn-info" onClick={() => modalProps.onHide()}>
|
|
{t('ok')}
|
|
</button>
|
|
</Modal.Footer>
|
|
</AccessibleModal>
|
|
)
|
|
}
|
|
|
|
export default memo(GenericMessageModal)
|