/
vshmidt
/
label-studio
Обзор
Документация
Войти
/
vshmidt
/
label-studio
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
web/libs/editor/src/common/Input/Input.jsx
29 строк
798 B
Raul Martin
feat: Migrate SCSS to plain CSS with PostCSS, replace Stylelint with Biome (#9584)
12 мар 2026, 20:57
Не верифицирован
12 мар 2026, 20:57
3f31128
Код
Авторство
О чём код?
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;