import React from 'react' import './VideoMessage.css' import classNames from 'classnames' import ProgressCircle from '../Circle/Circle' import { IProgressOptions, IVideoMessageProps } from '../type' import { HugeiconsIcon } from '@hugeicons/react'; // @ts-ignore import { CloudDownloadIcon, Alert02Icon } from '@hugeicons/core-free-icons'; const VideoMessage: React.FC = props => { var progressOptions = { strokeWidth: 2.3, color: '#efe', trailColor: '#aaa', trailWidth: 1, step: ( data: IProgressOptions, circle: { path: { setAttribute: (arg0: string, arg1: string) => void } value: () => number setText: (arg0: string | number) => void } ) => { circle.path.setAttribute('trail', (data.state !== undefined && data?.state?.color) || '') circle.path.setAttribute('trailwidth-width', (data.state !== undefined && data?.state?.width) || '') var value = Math.round(circle?.value() * 100) if (value === 0) circle?.setText('') else circle?.setText(value) }, } const error = props?.data?.status && props?.data?.status.error === true const downloaded = props?.data?.status && props?.data?.status.download return (
{!downloaded && ( {props?.data.alt} )} {downloaded && ( )} {error && (
)} {!error && props?.data?.status && !downloaded && (
{!props.data.status.click && ( )} {typeof props.data.status.loading === 'number' && props.data.status.loading !== 0 && ( )}
)}
{props?.text &&
{props.text}
}
) } export default VideoMessage