mirror of
https://github.com/upscayl/upscayl.git
synced 2026-04-03 03:00:13 -04:00
- 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.
27 lines
659 B
TypeScript
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;
|