Spaces:
Running
Running
Download src/Interactive.jsx from orchestrel-ai/README: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/spaces/orchestrel-ai/README/resolve/main/src/Interactive.jsx
- Command line
-
hf download hf://spaces/orchestrel-ai/README/src/Interactive.jsx
-
curl -L -o Interactive.jsx https://huggingface.co/spaces/orchestrel-ai/README/resolve/main/src/Interactive.jsx
1.02 kB
| import { useState } from 'react' | |
| import colorSvg from './assets/logo-horizontal.svg?raw' | |
| import monoSvg from './assets/logo-horizontal-mono-white.svg?raw' | |
| import Card from './Card.jsx' | |
| import SignalBar from './SignalBar.jsx' | |
| // Client-only build: inline both logos as data URIs at runtime. | |
| const uri = (svg) => | |
| 'data:image/svg+xml;base64,' + btoa(unescape(encodeURIComponent(svg))) | |
| // Client-only entry for the Space. React does the actual work here: | |
| // theme state (with the brand-required logo swap), and the React-driven | |
| // signal bar. The static org card never runs this file. | |
| export default function Interactive() { | |
| // ?theme=dark lets the dark card be shared/previewed directly. | |
| const [dark, setDark] = useState( | |
| () => | |
| typeof location !== 'undefined' && | |
| new URLSearchParams(location.search).get('theme') === 'dark', | |
| ) | |
| return ( | |
| <Card | |
| logoSrc={dark ? uri(monoSvg) : uri(colorSvg)} | |
| dark={dark} | |
| onToggle={() => setDark((d) => !d)} | |
| bar={<SignalBar />} | |
| /> | |
| ) | |
| } |