Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | import { memo, useCallback } from 'react'; import { FormattedMessage } from 'react-intl'; import { Modal } from '@allshares/studio-design-system'; import { PlanVisibility } from '@amalia/payout-definition/plans/types'; import { usePatchPlanVisibility } from '@amalia/payout-definition/state'; import { type PlanVisibilityModalCommonProps } from './types'; export type PlanVisibilityPublishModalProps = PlanVisibilityModalCommonProps; export const PlanVisibilityPublishModal = memo(function PlanVisibilityPublishModal({ closeModal, isOpen, planId, planName, }: PlanVisibilityPublishModalProps) { const { mutate: patchPlanVisibility } = usePatchPlanVisibility(planId); const handleClickPublish = useCallback(() => { patchPlanVisibility({ visibility: PlanVisibility.LIVE, }); closeModal(); }, [closeModal, patchPlanVisibility]); return ( <Modal isOpen={isOpen} onClose={closeModal} > <Modal.Content> <Modal.Header> <Modal.Title> <FormattedMessage defaultMessage="Publish plan" /> </Modal.Title> </Modal.Header> <Modal.Body> <FormattedMessage defaultMessage="Are you sure you want to publish the plan “<b>{planName}</b>”?{br}The users assigned to this plan will now be able to see their statements." values={{ planName, b: (chunks) => <strong>{chunks}</strong> }} /> </Modal.Body> </Modal.Content> <Modal.Actions> <Modal.CancelAction /> <Modal.MainAction onClick={handleClickPublish}> <FormattedMessage defaultMessage="Confirm" /> </Modal.MainAction> </Modal.Actions> </Modal> ); }); |