aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/components/Inputs/Text.js
blob: 866da918b934da30d17c2b730246b3bcc7a4695b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import CharLimit from "../decorators/CharLimit";
import React from "react";
import {Labelled} from "./shared";

export const Text = React.forwardRef(({label, id, readOnly, onChange, value, maxLength, autoFocus}, ref) => {
  return (
    <Labelled label={label} value={value}>
      <input
        ref={ref}
        name={label}
        readOnly={readOnly}
        className="lt-shadow"
        placeholder="Title"
        id={id}
        type="text"
        autoFocus={autoFocus}
        autoComplete="off"
        onChange={onChange}
        value={value} />
      <CharLimit
        content={value}
        maxLength={maxLength} />
    </Labelled>
  );
})