Codeminer42/cm42-central

View on GitHub
app/assets/javascripts/components/story/StoryLabels.jsx

Summary

Maintainability
A
0 mins
Test Coverage
import React, { Fragment } from 'react';
import TaggedInput from 'components/jquery_wrappers/TaggedInput';

const StoryLabels = ({
  name,
  className,
  value,
  availableLabels,
  onChange,
  disabled = false,
}) => (
  <Fragment>
    <label htmlFor={name}>
      {I18n.t(`activerecord.attributes.story.${name}`)}
    </label>
    <br />
    <TaggedInput
      onChange={onChange}
      availableLabels={availableLabels}
      disabled={disabled}
      input={{
        name,
        defaultValue: value,
        className: `form-control input-sm ${className}`,
        disabled,
      }}
    />
  </Fragment>
);

export default StoryLabels;