Spaces:
Configuration error
Configuration error
Download web/libs/editor/src/common/Input/Input.jsx from bisalsaha/lebel-studio: direct link, hf CLI and curl.
- Browser
- Download file 798 Bytes
-
https://huggingface.co/spaces/bisalsaha/lebel-studio/resolve/main/web/libs/editor/src/common/Input/Input.jsx
- Command line
-
hf download hf://spaces/bisalsaha/lebel-studio/web/libs/editor/src/common/Input/Input.jsx
-
curl -L -o Input.jsx https://huggingface.co/spaces/bisalsaha/lebel-studio/resolve/main/web/libs/editor/src/common/Input/Input.jsx
798 Bytes
| import { forwardRef, useMemo } from "react"; | |
| import { cn } from "../../utils/bem"; | |
| import Label from "../Label/Label"; | |
| import "./Input.prefix.css"; | |
| const Input = forwardRef(({ label, className, required, labelProps, ghost, waiting, ...props }, ref) => { | |
| const rootClass = cn("input"); | |
| const classList = [rootClass.mod({ ghost }), className].join(" ").trim(); | |
| const input = useMemo(() => { | |
| return waiting ? ( | |
| <div className={rootClass.elem("spinner").toClassName()} /> | |
| ) : ( | |
| <input {...props} ref={ref} className={classList} /> | |
| ); | |
| }, [props, ref, classList, waiting]); | |
| return label ? ( | |
| <Label {...(labelProps ?? {})} text={label} required={required}> | |
| {input} | |
| </Label> | |
| ) : ( | |
| input | |
| ); | |
| }); | |
| Input.displayName = "Input"; | |
| export default Input; | |