mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-15 02:30:58 -05:00
5b6bbcb73c
[web] Migrate notifications and error boundaries on the editor page GitOrigin-RevId: c195ecf0dd9e38ec8326c823174e559e1f192ce1
43 lines
1,022 B
TypeScript
43 lines
1,022 B
TypeScript
import { useTranslation } from 'react-i18next'
|
|
import { memo } from 'react'
|
|
import OLModal, {
|
|
OLModalBody,
|
|
OLModalFooter,
|
|
OLModalHeader,
|
|
OLModalTitle,
|
|
} from '@/features/ui/components/ol/ol-modal'
|
|
import OLButton from '@/features/ui/components/ol/ol-button'
|
|
|
|
export type GenericMessageModalOwnProps = {
|
|
title: string
|
|
message: string
|
|
}
|
|
|
|
type GenericMessageModalProps = React.ComponentProps<typeof OLModal> &
|
|
GenericMessageModalOwnProps
|
|
|
|
function GenericMessageModal({
|
|
title,
|
|
message,
|
|
...modalProps
|
|
}: GenericMessageModalProps) {
|
|
const { t } = useTranslation()
|
|
|
|
return (
|
|
<OLModal {...modalProps}>
|
|
<OLModalHeader closeButton>
|
|
<OLModalTitle>{title}</OLModalTitle>
|
|
</OLModalHeader>
|
|
|
|
<OLModalBody className="modal-body-share">{message}</OLModalBody>
|
|
|
|
<OLModalFooter>
|
|
<OLButton variant="secondary" onClick={() => modalProps.onHide()}>
|
|
{t('ok')}
|
|
</OLButton>
|
|
</OLModalFooter>
|
|
</OLModal>
|
|
)
|
|
}
|
|
|
|
export default memo(GenericMessageModal)
|