import classNames from "classnames"; import { getResourceType, 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 (getResourceType(resource).startsWith("image")) { const url = getResourceUrl(resource); return ( showPreviewImageDialog([url], 0)} decoding="async" loading="lazy" /> ); } const ResourceIcon = Icon.FileText; return ; }; export default ResourceIcon;