Files
upscayl/renderer/components/main-content/image-viewer.tsx
anna7261 575586515a refactor: remove electron.vite.config.mts and update dependencies in package.json and package-lock.json
- Deleted the electron.vite.config.mts file.
- Updated various dependencies in package.json and package-lock.json, including:
  - Bumped versions for @tailwindcss packages, cmdk, lucide-react, react-markdown, react-resizable-panels, react-select, react-tooltip, tailwind-merge, and others.
  - Updated devDependencies for @types packages and @vitejs/plugin-react.
- Adjusted PostCSS configuration to use @tailwindcss/postcss.
- Made minor adjustments to Tailwind CSS configuration and global styles.
2025-12-16 22:40:49 -04:00

27 lines
659 B
TypeScript

import { sanitizePath } from "@common/sanitize-path";
const ImageViewer = ({
imagePath,
setDimensions,
}: {
imagePath: string;
setDimensions: (dimensions: { width: number; height: number }) => void;
}) => {
return (
<img
src={"file:///" + sanitizePath(imagePath)}
onLoad={(e: React.SyntheticEvent<HTMLImageElement>) => {
setDimensions({
width: e.currentTarget.naturalWidth,
height: e.currentTarget.naturalHeight,
});
}}
draggable="false"
alt=""
className="h-full w-full bg-linear-to-br from-base-300 to-base-100 object-contain"
/>
);
};
export default ImageViewer;