Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Download components/editor/main/parameter.tsx from enzostvs/hub-api-playground: direct link, hf CLI and curl.
- Browser
- Download file 583 Bytes
-
https://huggingface.co/spaces/enzostvs/hub-api-playground/resolve/ecaee451983f85e8a45f037cfc40eba1e234a5c7/components/editor/main/parameter.tsx
- Command line
-
hf download hf://spaces/enzostvs/hub-api-playground@ecaee451983f85e8a45f037cfc40eba1e234a5c7/components/editor/main/parameter.tsx
-
curl -L -o parameter.tsx https://huggingface.co/spaces/enzostvs/hub-api-playground/resolve/ecaee451983f85e8a45f037cfc40eba1e234a5c7/components/editor/main/parameter.tsx
583 Bytes
| import { useMemo, useState } from "react"; | |
| import classNames from "classnames"; | |
| import { on } from "events"; | |
| interface Props { | |
| value: string; | |
| onChange: (value: string) => void; | |
| } | |
| export const Parameter: React.FC<Props> = ({ value, onChange }) => { | |
| const [state, setState] = useState(value); | |
| return ( | |
| <input | |
| type="text" | |
| className="bg-indigo-600 !text-white px-1.5 rounded-md outline-none bg-opacity-80 max-w-[80px] text-center truncate" | |
| onBlur={() => onChange(state)} | |
| value={state} | |
| onChange={(e) => setState(e.target.value)} | |
| /> | |
| ); | |
| }; | |