{"version":3,"file":"VideoThumbnail.mjs","names":[],"sources":["../../../../src/components/VideoPlayer/VideoThumbnail.tsx"],"sourcesContent":["import { type BaseImageProps, BaseImage as DefaultBaseImage } from '../BaseImage';\nimport { Button } from '../Button';\nimport clsx from 'clsx';\nimport React from 'react';\nimport {\n  useComponentContext,\n  useComponentContextIcons,\n  useTranslationContext,\n} from '../../context';\n\nexport type VideoThumbnailProps = BaseImageProps & {\n  onPlay?: () => void;\n};\n\nexport const VideoThumbnail = ({\n  className,\n  onPlay,\n  ...imageProps\n}: VideoThumbnailProps) => {\n  const { IconPlayFill } = useComponentContextIcons();\n  const { BaseImage = DefaultBaseImage } = useComponentContext();\n  const { t } = useTranslationContext();\n\n  return (\n    <div className='str-chat__message-attachment__video-thumbnail'>\n      {imageProps.src ? (\n        <BaseImage\n          className={clsx(\n            'str-chat__message-attachment__video-thumbnail-image',\n            className,\n          )}\n          {...imageProps}\n        />\n      ) : (\n        // A video without a thumbnail shows a blank frame under the play indicator.\n        <div\n          aria-hidden='true'\n          className={clsx(\n            'str-chat__message-attachment__video-thumbnail-image',\n            'str-chat__message-attachment__video-thumbnail-placeholder',\n            className,\n          )}\n          data-testid='str-chat__video-thumbnail-placeholder'\n        />\n      )}\n      {onPlay ? (\n        <Button\n          appearance='solid'\n          aria-label={t('videoPlayer.videoThumbnail.playVideo.ariaLabel', 'Play video')}\n          circular\n          className={clsx(\n            'str-chat__message-attachment__video-thumbnail__play-indicator',\n          )}\n          onClick={onPlay}\n          size='lg'\n          variant='secondary'\n        >\n          <IconPlayFill />\n        </Button>\n      ) : (\n        <div className='str-chat__message-attachment__video-thumbnail__play-indicator'>\n          <IconPlayFill />\n        </div>\n      )}\n    </div>\n  );\n};\n"],"mappings":";;;;;;;;;AAcA,IAAa,kBAAkB,EAC7B,WACA,QACA,GAAG,iBACsB;CACzB,MAAM,EAAE,iBAAiB,yBAAyB;CAClD,MAAM,EAAE,WAAA,cAAY,cAAqB,oBAAoB;CAC7D,MAAM,EAAE,MAAM,sBAAsB;CAEpC,OACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACG,WAAW,MACV,oBAAC,aAAD;GACE,WAAW,KACT,uDACA,SACF;GACA,GAAI;EACL,CAAA,IAGD,oBAAC,OAAD;GACE,eAAY;GACZ,WAAW,KACT,uDACA,6DACA,SACF;GACA,eAAY;EACb,CAAA,GAEF,SACC,oBAAC,QAAD;GACE,YAAW;GACX,cAAY,EAAE,kDAAkD,YAAY;GAC5E,UAAA;GACA,WAAW,KACT,+DACF;GACA,SAAS;GACT,MAAK;GACL,SAAQ;aAER,oBAAC,cAAD,CAAe,CAAA;EACT,CAAA,IAER,oBAAC,OAAD;GAAK,WAAU;aACb,oBAAC,cAAD,CAAe,CAAA;EACZ,CAAA,CAEJ;;AAET"}