{"version":3,"file":"CardHeader-Cx-VonJp.js","sources":["../../../frontend/src/Components/DesignSystem/CardHeader/CardHeader.tsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { injectIntl } from 'react-intl';\nimport { Box, Grid2 as Grid, Typography, CardHeader as MuiCardHeader } from '@mui/material';\nimport { styled } from '@mui/material/styles';\nimport { ReactSVG } from 'react-svg';\n\nimport { Icons } from '../../../Themes';\nimport { moment } from '../../../I18n';\nimport Avatar from '../Avatar';\nimport Chip from '../Chip';\n\nconst StyledVerifiedSpace = styled(ReactSVG)(({ theme }: any) => ({\n width: 15,\n height: 15,\n marginLeft: theme.spacing(1.5),\n '& path': {\n fill: theme.palette.secondary.main,\n },\n}));\n\nfunction CardHeader({\n isAuthor = false,\n action = null,\n alt,\n avatarSize = 48,\n badge = null,\n date = undefined,\n subheader = null,\n extra,\n fullName,\n initials = '',\n intl,\n isVerified = false,\n placeholderType = 'user',\n profilePictureUrl = null,\n}: any) {\n const renderPublishState = () => {\n if (date === undefined) {\n return null;\n }\n\n if (moment(date).isValid()) {\n return (\n \n {moment(date).fromNow()}\n \n );\n }\n\n return intl.formatMessage({ id: 'ARTICLE.NOT_PUBLISHED' });\n };\n\n return (\n \n }\n title={\n \n \n {fullName}\n \n {isVerified && }\n {isAuthor && (\n \n \n \n )}\n \n }\n subheader={\n \n {subheader}\n {subheader && date !== undefined && ' - '}\n {renderPublishState()}\n {extra}\n \n }\n action={action}\n />\n );\n}\n\nCardHeader.propTypes = {\n isAuthor: PropTypes.bool,\n isVerified: PropTypes.bool,\n fullName: PropTypes.string.isRequired,\n profilePictureUrl: PropTypes.string,\n date: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.string]),\n subheader: PropTypes.string,\n placeholderType: PropTypes.oneOf(['user', 'entity']),\n badge: PropTypes.node,\n alt: PropTypes.string.isRequired,\n action: PropTypes.node,\n avatarSize: PropTypes.number,\n initials: PropTypes.string,\n};\n\nexport default injectIntl(CardHeader);\n"],"names":["StyledVerifiedSpace","styled","ReactSVG","_ref","theme","width","height","marginLeft","spacing","fill","palette","secondary","main","CardHeader","_ref2","_ref2$isAuthor","isAuthor","_ref2$action","action","alt","_ref2$avatarSize","avatarSize","_ref2$badge","badge","_ref2$date","date","undefined","_ref2$subheader","subheader","extra","fullName","_ref2$initials","initials","intl","_ref2$isVerified","isVerified","_ref2$placeholderType","placeholderType","_ref2$profilePictureU","profilePictureUrl","renderPublishState","moment","isValid","React","createElement","Typography","variant","sx","textTransform","fromNow","formatMessage","id","MuiCardHeader","padding","avatar","Avatar","src","size","title","Grid","container","alignItems","marginX","color","fontWeight","fontSize","letterSpacing","Icons","entities","verified","Box","ml","Chip","label","typographyComponent","gap","display","justifyContent","mx","propTypes","PropTypes","bool","string","isRequired","oneOfType","instanceOf","Date","oneOf","node","number","injectIntl"],"mappings":"8MAYA,IAAMA,EAAsBC,EAAOC,CAAQ,EAAE,SAAAC,EAAe,CAAA,IAAZC,EAAKD,EAALC,MAAkB,MAAA,CAChEC,MAAO,GACPC,OAAQ,GACRC,WAAYH,EAAMI,QAAQ,GAAG,EAC7B,SAAU,CACRC,KAAML,EAAMM,QAAQC,UAAUC,IAAAA,CAElC,CAAC,CAAC,EAEF,SAASC,EAAUC,EAeX,CAAA,IAAAC,EAAAD,EAdNE,SAAAA,EAAQD,IAAG,OAAA,GAAKA,EAAAE,EAAAH,EAChBI,OAAAA,EAAMD,IAAG,OAAA,KAAIA,EACbE,EAAGL,EAAHK,IAAGC,EAAAN,EACHO,WAAAA,EAAUD,IAAG,OAAA,GAAEA,EAAAE,EAAAR,EACfS,MAAAA,EAAKD,IAAG,OAAA,KAAIA,EAAAE,EAAAV,EACZW,KAAAA,EAAID,IAAGE,OAAAA,OAASF,EAAAG,EAAAb,EAChBc,UAAAA,EAASD,IAAG,OAAA,KAAIA,EAChBE,EAAKf,EAALe,MACAC,EAAQhB,EAARgB,SAAQC,EAAAjB,EACRkB,SAAAA,EAAQD,IAAG,OAAA,GAAE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