import React from 'react';
import { as, toRem } from 'folds';
import { MatrixEvent } from 'matrix-js-sdk';
import {
AttachmentBox,
MessageBrokenContent,
MessageDeletedContent,
} from '../../../components/message';
import { ImageContent } from './ImageContent';
import { scaleYDimension } from '../../../utils/common';
import { IImageContent } from '../../../../types/matrix/common';
type StickerContentProps = {
mEvent: MatrixEvent;
autoPlay: boolean;
};
export const StickerContent = as<'div', StickerContentProps>(
({ mEvent, autoPlay, ...props }, ref) => {
if (mEvent.isRedacted()) return ;
const content = mEvent.getContent();
const imgInfo = content?.info;
const mxcUrl = content.file?.url ?? content.url;
if (typeof mxcUrl !== 'string') {
return ;
}
const height = scaleYDimension(imgInfo?.w || 152, 152, imgInfo?.h || 152);
return (
);
}
);