import React from 'react' import './PhotoMessage.css' import ProgressCircle from '../Circle/Circle' import { IPhotoMessageProps, IProgressOptions } from '../type' import { HugeiconsIcon } from '@hugeicons/react'; // @ts-ignore import { CloudDownloadIcon, Alert02Icon } from '@hugeicons/core-free-icons'; const PhotoMessage: React.FC = props => { var progressOptions = { strokeWidth: 2.3, color: '#efe', trailColor: '#aaa', trailWidth: 1, step: ( state: IProgressOptions, circle: { path: { setAttribute: (arg0: string, arg1: any) => void } value: () => number setText: (arg0: string | number) => void } ) => { circle.path.setAttribute('trail', state?.state?.color) circle.path.setAttribute('trailwidth-width', state?.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 return (
{props?.data?.alt} {error && (
)} {!error && props?.data?.status && !props?.data?.status?.download && (
{!props?.data?.status.click && ( )} {typeof props?.data?.status.loading === 'number' && props?.data?.status.loading !== 0 && ( )}
)}
{props?.text &&
{props.text}
}
) } export default PhotoMessage