UNPKG

@plteam/chat-ui

Version:

CUI Kit is a free and open-source library for creating AI assistant chat interfaces, built with React, Material UI, and TypeScript

14 lines (13 loc) 877 B
import React from 'react'; import Skeleton from '@mui/material/Skeleton'; import 'photoswipe/style.css'; import PlayIcon from './PlayIcon'; const GalleryItem = ({ poster, id, videoUrl, showPlayIcon, className }) => { if (!poster) { return (React.createElement(Skeleton, { variant: 'rounded', sx: { borderRadius: '16px' }, width: "100%", height: "100%" })); } return (React.createElement("a", { key: id, href: videoUrl ? videoUrl : poster.src, "data-pswp-width": poster.width, "data-pswp-height": poster.height, "data-pswp-type": videoUrl ? "video" : undefined, "data-pswp-video-src": videoUrl ? videoUrl : undefined, target: "_blank", rel: "noreferrer" }, showPlayIcon ? React.createElement(PlayIcon, null) : null, React.createElement("img", { className: className, src: poster.src, alt: "" }))); }; export default GalleryItem;