{"version":3,"file":"ContentTypeRadioGroup.mjs","sources":["../../../admin/src/components/ContentTypeRadioGroup.tsx"],"sourcesContent":["import { useNotification } from '@strapi/admin/strapi-admin';\nimport { useIntl } from 'react-intl';\n\nimport { getTrad } from '../utils';\n\nimport { CustomRadioGroup } from './CustomRadioGroup';\n\nimport type { IntlLabel } from '../types';\n\ninterface Radio {\n  title: IntlLabel;\n  description: IntlLabel;\n  value: any;\n}\n\ninterface ContentTypeRadioGroupProps {\n  intlLabel: IntlLabel;\n  name: string;\n  onChange: (value: any) => void;\n  radios?: Radio[];\n  value?: string | boolean;\n}\n\nexport const ContentTypeRadioGroup = ({ onChange, ...rest }: ContentTypeRadioGroupProps) => {\n  const { formatMessage } = useIntl();\n  const { toggleNotification } = useNotification();\n\n  const handleChange = (e: any) => {\n    toggleNotification({\n      type: 'info',\n      message: formatMessage({\n        id: getTrad('contentType.kind.change.warning'),\n        defaultMessage:\n          'You just changed the kind of a content type: API will be reset (routes, controllers, and services will be overwritten).',\n      }),\n    });\n\n    onChange(e);\n  };\n\n  return <CustomRadioGroup {...rest} onChange={handleChange} />;\n};\n"],"names":["ContentTypeRadioGroup","onChange","rest","formatMessage","useIntl","toggleNotification","useNotification","handleChange","e","type","message","id","getTrad","defaultMessage","_jsx","CustomRadioGroup"],"mappings":";;;;;;MAuBaA,qBAAwB,GAAA,CAAC,EAAEC,QAAQ,EAAE,GAAGC,IAAkC,EAAA,GAAA;IACrF,MAAM,EAAEC,aAAa,EAAE,GAAGC,OAAAA,EAAAA;IAC1B,MAAM,EAAEC,kBAAkB,EAAE,GAAGC,eAAAA,EAAAA;AAE/B,IAAA,MAAMC,eAAe,CAACC,CAAAA,GAAAA;QACpBH,kBAAmB,CAAA;YACjBI,IAAM,EAAA,MAAA;AACNC,YAAAA,OAAAA,EAASP,aAAc,CAAA;AACrBQ,gBAAAA,EAAAA,EAAIC,OAAQ,CAAA,iCAAA,CAAA;gBACZC,cACE,EAAA;AACJ,aAAA;AACF,SAAA,CAAA;QAEAZ,QAASO,CAAAA,CAAAA,CAAAA;AACX,KAAA;AAEA,IAAA,qBAAOM,GAACC,CAAAA,gBAAAA,EAAAA;AAAkB,QAAA,GAAGb,IAAI;QAAED,QAAUM,EAAAA;;AAC/C;;;;"}