Codeminer42/cm42-central

View on GitHub
app/assets/javascripts/components/story/ExpandedStory/ExpandedStoryOwnedBy.jsx

Summary

Maintainability
B
4 hrs
Test Coverage
import React from 'react';
import PropTypes from 'prop-types';
import SelectUser from '../select_user/SelectUser';
import { editingStoryPropTypesShape } from '../../../models/beta/story';
import ExpandedStorySection from './ExpandedStorySection';

const ExpandedStoryOwnedBy = ({ users, story, onEdit, disabled }) => (
  <ExpandedStorySection
    title={I18n.t('activerecord.attributes.story.owned_by')}
  >
    <SelectUser
      users={users}
      selectedUserId={story._editing.ownedById}
      onEdit={onEdit}
      disabled={disabled}
    />
  </ExpandedStorySection>
);

ExpandedStoryOwnedBy.propTypes = {
  users: PropTypes.array.isRequired,
  story: editingStoryPropTypesShape.isRequired,
  onEdit: PropTypes.func.isRequired,
  disabled: PropTypes.bool.isRequired,
};

export default ExpandedStoryOwnedBy;