import classNames from "classnames"; import { getResourceUrl } from "@/utils/resource"; import Icon from "./Icon"; import showPreviewImageDialog from "./PreviewImageDialog"; import SquareDiv from "./kit/SquareDiv"; interface Props { className: string; resource: Resource; } const ResourceIcon = (props: Props) => { const { className, resource } = props; if (resource.type.includes("image")) { const url = getResourceUrl(resource); return ( showPreviewImageDialog([url], 0)} decoding="async" loading="lazy" /> ); } const ResourceIcon = Icon.FileText; return ; }; export default ResourceIcon;