{"version":3,"file":"AnswerShow-7ZtKwB9r.js","sources":["../../../frontend/src/Components/Posts/Show/Participation/FormBuilder/AnswerShow.tsx"],"sourcesContent":["import React from 'react';\nimport { Box, Chip, Stack, Typography } from '@mui/material';\nimport { useIntl } from 'react-intl';\n\nimport AttachmentLink from '../../../Shared/AttachmentLink';\nimport AttachmentLinksList from '../../../Shared/AttachmentLinksList';\nimport PostLocation from '../../../Shared/PostLocation';\nimport ReadMore from '../../../../ReadMore/ReadMore';\nimport { moment } from '../../../../../I18n';\n\ninterface AnswerShowProps {\n answer: any;\n showPreview?: boolean;\n geojson?: string | null;\n}\n\nexport default function AnswerShow({ answer, showPreview, geojson }: AnswerShowProps) {\n const intl = useIntl();\n\n if (!answer) {\n return null;\n }\n\n const { lat, lng } = answer;\n\n if (answer?.question_options?.length > 0) {\n return (\n \n {answer.question_options.map((qo: any) => {\n return (\n \n {qo.other ? answer.content_i18n : qo.label}\n \n }\n size=\"small\"\n variant=\"outlined\"\n sx={{ backgroundColor: 'white', height: '100%' }}\n />\n );\n })}\n \n );\n }\n\n if (!!lat && !!lng) {\n return ;\n }\n\n if (answer?.date) {\n return moment(answer.date).format(intl.formatMessage({ id: 'MOMENT.DATE.DEFAULT' }));\n }\n\n if (answer?.content || answer?.content_i18n) {\n return ;\n }\n\n if (answer?.attachments?.length > 0) {\n if (showPreview) {\n return ;\n }\n\n return (\n \n {answer.attachments.map((attachment: any) => (\n \n \n \n ))}\n \n );\n }\n\n return null;\n}\n"],"names":["AnswerShow","_ref","_answer$question_opti","_answer$attachments","answer","showPreview","geojson","intl","useIntl","lat","lng","question_options","length","React","createElement","Stack","direction","sx","justifyContent","alignItems","flexWrap","gap","map","qo","Chip","key","id","label","Typography","variant","style","whiteSpace","other","content_i18n","size","backgroundColor","height","PostLocation","content","date","moment","format","formatMessage","ReadMore","attachments","AttachmentLinksList","Box","role","attachment","url","my","AttachmentLink"],"mappings":"iTAgBA,SAAwBA,EAAUC,EAAoD,CAAA,IAAAC,EA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