/**
* Images.
*
* A plan references an image by absolute URL, so rendering one is an `
`
* and nothing more. Referrers are suppressed because plan content is written
* by an agent as well as by people: loading it should not tell a third party
* where the request came from.
*/
import { useState } from "react";
import type { ImageNode } from "@chopin/dialect";
function Image({ alt, src }: { alt: string; src: string }) {
let [failed, setFailed] = useState(false);
if (failed) {
return (
Image unavailable
);
}
return (
setFailed(true)}
referrerPolicy="no-referrer"
src={src}
/>
);
}
export function renderImage(node: ImageNode): unknown {
return ;
}