1
// cozyscreenshot — paste → customize → export
2
import { useState, useCallback } from "react";
3
import { toPng } from "html-to-image";
5
export default function App() {
6
const [image, setImage] = useState<string | null>(null);
7
const paste = useCallback(async () => {
8
const [item] = await navigator.clipboard.read();
9
const blob = await item.getType("image/png");
10
setImage(URL.createObjectURL(blob));
13
const download = async () => {
14
const node = document.getElementById("bs-capture-root")!;
15
const url = await toPng(node, { pixelRatio: 2 });
16
// → cozyscreenshot-1713…png 💾