</>App.tsx●
{}constants.ts
.cssglobals.css
cozyscreenshot
▾📁 src/app
▾📁 _components
◆App.tsx
◆Canvas.tsx
◆Controls.tsx
◆constants.ts
◆layout.tsx
◆page.tsx
◆globals.css
outline
TAppState
ƒhandleImage
ƒonExport
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 💾
⎇ main• 0 errors•TypeScript 5.6.3Ln 10, Col 34•UTF-8•LF