{"version":3,"file":"PostCreatedModal-Cv-f7hcr.js","sources":["../../../node_modules/@mui/icons-material/esm/Lock.js","../../../frontend/src/Components/Posts/Show/PostCreatedModal/PostCreatedModal.tsx"],"sourcesContent":["\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z\"\n}), 'Lock');","import React from 'react';\nimport { Button, Typography } from '@mui/material';\nimport { FormattedMessage, useIntl } from 'react-intl';\nimport { useSearchParams, Link } from 'react-router-dom';\n\nimport Dialog from '../../../DesignSystem/Dialog';\nimport { postTypePlural } from '../../../../Utils/Types';\nimport { isIdea, isAnomaly, isMessage } from '../../../../Utils/Post';\nimport useSpace from '../../../../Hooks/useSpace';\nimport usePinUnpinMutation from '../../../../Hooks/usePinUnpinMutation';\nimport ButtonWithLoader from '../../../ButtonWithLoader';\nimport { Post } from '../../../../Utils/Types/Posts';\n\ninterface PostCreatedModalProps {\n post: Post;\n isOpen?: boolean;\n}\n\nfunction PostCreatedModal({ isOpen = false, post }: PostCreatedModalProps) {\n const postType = post?.type;\n const intl = useIntl();\n const [search, setSearch] = useSearchParams();\n const { space } = useSpace();\n\n const open = isOpen || search.get('modal') === 'post-created';\n\n const closeModal = () => {\n setSearch({});\n };\n\n const { mutate: pinUnpinPost, isLoading: pinUnpinIsFetching } = usePinUnpinMutation({\n post,\n onSuccess: closeModal,\n });\n\n const pluralType = postTypePlural(postType).toUpperCase();\n\n const renderButtons = () => {\n const understoodButton = (\n \n );\n\n if (isIdea(postType)) {\n return (\n <>\n {understoodButton}\n \n >\n );\n }\n\n if (isAnomaly(postType) || isMessage(postType)) {\n return (\n <>\n {understoodButton}\n \n >\n );\n }\n\n return (\n <>\n {understoodButton}\n \n \n \n >\n );\n };\n\n if (!open || !post) return null;\n\n return (\n }\n actions={renderButtons()}\n >\n \n \n \n \n );\n}\n\nexport default PostCreatedModal;\n"],"names":["Lock","createSvgIcon","_jsx","PostCreatedModal","_ref","_ref$isOpen","isOpen","post","postType","type","intl","useIntl","_useSearchParams","useSearchParams","_useSearchParams2","_slicedToArray","search","setSearch","_useSpace","useSpace","space","open","get","closeModal","_usePinUnpinMutation","usePinUnpinMutation","onSuccess","pinUnpinPost","mutate","pinUnpinIsFetching","isLoading","pluralType","postTypePlural","toUpperCase","renderButtons","understoodButton","createElement","Button","size","color","onClick","FormattedMessage","id","isIdea","React","Fragment","variant","component","Link","to","concat","slug","isAnomaly","isMessage","ButtonWithLoader","isFetching","Dialog","onClose","label","formatMessage","title","actions","Typography","values","isPrivateSpace","spaceName","name"],"mappings":"kPAIA,MAAAA,EAAeC,EAA2BC,EAAI,IAAC,OAAQ,CACrD,EAAG,wNACL,CAAC,EAAG,MAAM;u1BCYV,SAASC,EAAgBC,EAAkD,CAAAC,IAAAA,EAAAD,EAA/CE,OAAAA,EAAMD,IAAG,OAAA,GAAKA,EAAEE,EAAIH,EAAJG,KACpCC,EAAWD,GAAI,KAAJA,OAAAA,EAAME,KACjBC,EAAOC,EAAQ,EACrBC,EAA4BC,EAAAA,EAAiBC,EAAAC,EAAAH,EAAA,CAAA,EAAtCI,EAAMF,EAAA,CAAA,EAAEG,EAASH,EAAA,CAAA,EACxBI,EAAkBC,EAAAA,EAAVC,EAAKF,EAALE,MAEFC,EAAOf,GAAUU,EAAOM,IAAI,OAAO,IAAM,eAEzCC,EAAa,UAAM,CACvBN,EAAU,CAAA,CAAE,CACd,EAEAO,EAAgEC,EAAoB,CAClFlB,KAAAA,EACAmB,UAAWH,CAAAA,C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