/**
* ImageView shows a workspace image (png, jpeg, gif, webp, svg, bmp, ico,
* avif) at its natural size, capped to the pane width, over a checkerboard
* that reveals transparency. The bytes stream from GET /api/raw, and the
* natural dimensions appear once the browser has decoded the image.
*
* @example
*
*/
import { useState } from "react";
import { rawFileUrl } from "../api";
export function ImageView({ path }: { path: string }) {
const [size, setSize] = useState<{ width: number; height: number } | null>(
null,
);
const [failed, setFailed] = useState(false);
if (failed) {
return