{"version":3,"sources":["../ui/src/components/player-components/chat/chatCard.tsx"],"sourcesContent":["import Image from 'next/image'\r\nimport { ConditionName, IChatCardProps } from '../../../../../interfaces'\r\nimport { useAppSelector } from '../../../../../redux/hooks'\r\nimport { conditions, getRemainingTime } from '../../../../../helpers'\r\nimport { shallowEqual } from 'react-redux'\r\nimport dynamic from \"next/dynamic\";\r\n\r\nconst EmptyProfileIcon = dynamic(() => import(\"../../icon-components/emptyProfile\"));\r\n\r\nconst ChatCard = ({ message }: IChatCardProps) => {\r\n  const { usersInfoInChat } = useAppSelector(({ chats: { usersInfoInChat } }) => ({ usersInfoInChat }), shallowEqual);\r\n\r\n  const user = usersInfoInChat.find((user: any) => user.user_id === message.author)\r\n  return (\r\n    <div>\r\n      <div\r\n        className={`pl-flex pl-items-center pl-gap-1 pl-font-normal ${conditions(ConditionName.isTouchScreen) ? 'pl-text-[11px]' : 'pl-text-[14px]'}`}>\r\n        {user && Object.keys(user.profile).length > 0 && user.profile.avatar_url ?\r\n          <Image src={user.profile.avatar_url} width={24} height={24} alt='user-profile' className='pl-rounded-full' /> : <EmptyProfileIcon />}\r\n        <p\r\n          className='pl-text-main-highLight pl-text-[14px] pl-font-normal'>{user && Object.keys(user.profile).length > 0 ? user.profile.name : 'کاربر ناشناس'} .</p>\r\n        <span className=\"pl-text-z-secondary-600 dark:pl-text-z-gray-400 pl-text-[9px]\">{getRemainingTime(message.created_at)}</span>\r\n      </div>\r\n      <p\r\n        className='pl-text-[13px] pl-font-normal pl-text-z-gray-700 dark:pl-text-secondary-50 pl-break-words'>{message.text}</p>\r\n    </div>\r\n  )\r\n}\r\n\r\nexport default ChatCard"],"mappings":"0JAAAA,IAAA,OAAOC,MAAW,aAIlB,OAAS,gBAAAC,MAAoB,cAC7B,OAAOC,MAAa,eAaV,cAAAC,EACF,QAAAC,MADE,oBAXV,IAAMC,EAAmBH,EAAQ,IAAM,OAAO,6BAAoC,CAAC,EAE7EI,EAAW,CAAC,CAAE,QAAAC,CAAQ,IAAsB,CAChD,GAAM,CAAE,gBAAAC,CAAgB,EAAIC,EAAe,CAAC,CAAE,MAAO,CAAE,gBAAAD,CAAgB,CAAE,KAAO,CAAE,gBAAAA,CAAgB,GAAIP,CAAY,EAE5GS,EAAOF,EAAgB,KAAME,GAAcA,EAAK,UAAYH,EAAQ,MAAM,EAChF,OACEH,EAAC,OACC,UAAAA,EAAC,OACC,UAAW,mDAAmDO,iBAAsC,EAAI,iBAAmB,gBAAgB,GAC1I,UAAAD,GAAQ,OAAO,KAAKA,EAAK,OAAO,EAAE,OAAS,GAAKA,EAAK,QAAQ,WAC5DP,EAACS,EAAA,CAAM,IAAKF,EAAK,QAAQ,WAAY,MAAO,GAAI,OAAQ,GAAI,IAAI,eAAe,UAAU,kBAAkB,EAAKP,EAACE,EAAA,EAAiB,EACpID,EAAC,KACC,UAAU,uDAAwD,UAAAM,GAAQ,OAAO,KAAKA,EAAK,OAAO,EAAE,OAAS,EAAIA,EAAK,QAAQ,KAAO,sEAAe,MAAE,EACxJP,EAAC,QAAK,UAAU,gEAAiE,SAAAU,EAAiBN,EAAQ,UAAU,EAAE,GACxH,EACAJ,EAAC,KACC,UAAU,4FAA6F,SAAAI,EAAQ,KAAK,GACxH,CAEJ,EAEOO,EAAQR","names":["init_esm_shims","Image","shallowEqual","dynamic","jsx","jsxs","EmptyProfileIcon","ChatCard","message","usersInfoInChat","useAppSelector","user","conditions","Image","getRemainingTime","chatCard_default"]}