/* eslint react/no-array-index-key: "off" */ import { Components } from 'botframework-webchat-component'; import PropTypes from 'prop-types'; import React, { FC } from 'react'; import type { DirectLineAudioCard } from 'botframework-webchat-core'; import CommonCard from './CommonCard'; import useStyleSet from '../../hooks/useStyleSet'; const { AudioContent } = Components; type AudioCardContentProps = { actionPerformedClassName?: string; content: DirectLineAudioCard; disabled?: boolean; }; const AudioCardContent: FC = ({ actionPerformedClassName, content, disabled }) => { const [{ audioCardAttachment: audioCardAttachmentStyleSet }] = useStyleSet(); const { autostart = false, autoloop = false, image: { url: imageURL = '' } = {}, media = [] } = content; return (
); }; AudioCardContent.defaultProps = { actionPerformedClassName: '', disabled: undefined }; AudioCardContent.propTypes = { actionPerformedClassName: PropTypes.string, // PropTypes cannot fully capture TypeScript types. // @ts-ignore content: PropTypes.shape({ autostart: PropTypes.bool, autoloop: PropTypes.bool, image: PropTypes.shape({ url: PropTypes.string.isRequired }), media: PropTypes.arrayOf( PropTypes.shape({ url: PropTypes.string.isRequired }).isRequired ).isRequired }).isRequired, disabled: PropTypes.bool }; export default AudioCardContent;