Path: blob/master/src/packages/frontend/account/settings/text-setting.tsx
5891 views
/*1* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { Input } from "antd";67import { COLORS } from "@cocalc/util/theme";89import { LabeledRow } from "@cocalc/frontend/components";1011// in a grid: Title [text input]12interface Props {13label: string;14value?: string;15onChange: (e) => void;16onBlur?: (e) => void;17onFocus?: () => void;18onPressEnter?: (e) => void;19maxLength?: number;20disabled?: boolean;21title?: string; // tooltip text22}2324// Note -- we disable all password manager autocomplete, since this is a component25// that's used internally in the app for configuration. See https://github.com/sagemathinc/cocalc/issues/68682627export function TextSetting(props: Props): React.JSX.Element {28return (29<LabeledRow30label={props.label}31style={props.disabled ? { color: COLORS.GRAY_M } : undefined}32>33<Input34value={props.value}35onChange={props.onChange}36onBlur={props.onBlur}37onFocus={props.onFocus}38onPressEnter={props.onPressEnter}39maxLength={props.maxLength}40disabled={props.disabled}41title={props.title}42autoComplete={"off"}43data-lpignore="true"44data-1p-ignore45/>46</LabeledRow>47);48}495051