ElectronicBabylonianLiterature/ebl-frontend

View on GitHub
src/dictionary/ui/editor/TextListInput.tsx

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import React, { Component } from 'react'
import { FormGroup } from 'react-bootstrap'

import TextInput from './TextInput'
import List from 'common/List'

class ListInput extends Component<{ value; onChange }> {
  render(): JSX.Element {
    return (
      <FormGroup>
        <List
          label={this.props.children}
          value={this.props.value}
          onChange={this.props.onChange}
          defaultValue=""
        >
          {(item, onChange) => <TextInput onChange={onChange} value={item} />}
        </List>
      </FormGroup>
    )
  }
}

export default ListInput