2023-10-27 04:43:50 -04:00
|
|
|
import { useTranslation } from 'react-i18next'
|
2023-12-14 05:43:00 -05:00
|
|
|
import { memo } from 'react'
|
2024-10-11 05:23:33 -04:00
|
|
|
import OLModal, {
|
|
|
|
OLModalBody,
|
|
|
|
OLModalFooter,
|
|
|
|
OLModalHeader,
|
|
|
|
OLModalTitle,
|
|
|
|
} from '@/features/ui/components/ol/ol-modal'
|
|
|
|
import OLButton from '@/features/ui/components/ol/ol-button'
|
2023-10-27 04:43:50 -04:00
|
|
|
|
|
|
|
export type GenericMessageModalOwnProps = {
|
|
|
|
title: string
|
|
|
|
message: string
|
|
|
|
}
|
|
|
|
|
2024-10-11 05:23:33 -04:00
|
|
|
type GenericMessageModalProps = React.ComponentProps<typeof OLModal> &
|
2023-10-27 04:43:50 -04:00
|
|
|
GenericMessageModalOwnProps
|
|
|
|
|
|
|
|
function GenericMessageModal({
|
|
|
|
title,
|
|
|
|
message,
|
|
|
|
...modalProps
|
|
|
|
}: GenericMessageModalProps) {
|
|
|
|
const { t } = useTranslation()
|
|
|
|
|
|
|
|
return (
|
2024-10-11 05:23:33 -04:00
|
|
|
<OLModal {...modalProps}>
|
|
|
|
<OLModalHeader closeButton>
|
|
|
|
<OLModalTitle>{title}</OLModalTitle>
|
|
|
|
</OLModalHeader>
|
2023-10-27 04:43:50 -04:00
|
|
|
|
2024-10-11 05:23:33 -04:00
|
|
|
<OLModalBody className="modal-body-share">{message}</OLModalBody>
|
2023-10-27 04:43:50 -04:00
|
|
|
|
2024-10-11 05:23:33 -04:00
|
|
|
<OLModalFooter>
|
|
|
|
<OLButton variant="secondary" onClick={() => modalProps.onHide()}>
|
2023-10-27 04:43:50 -04:00
|
|
|
{t('ok')}
|
2024-10-11 05:23:33 -04:00
|
|
|
</OLButton>
|
|
|
|
</OLModalFooter>
|
|
|
|
</OLModal>
|
2023-10-27 04:43:50 -04:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2023-12-14 05:43:00 -05:00
|
|
|
export default memo(GenericMessageModal)
|