You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.7 KiB
67 lines
1.7 KiB
5 years ago
|
import PropTypes from 'prop-types';
|
||
|
import React from 'react';
|
||
|
import { inputTypes } from 'Helpers/Props';
|
||
|
import LoadingIndicator from 'Components/Loading/LoadingIndicator';
|
||
|
import FieldSet from 'Components/FieldSet';
|
||
|
import Form from 'Components/Form/Form';
|
||
|
import FormGroup from 'Components/Form/FormGroup';
|
||
|
import FormLabel from 'Components/Form/FormLabel';
|
||
|
import FormInputGroup from 'Components/Form/FormInputGroup';
|
||
|
|
||
|
export const certificationCountryOptions = [
|
||
|
{ key: 'us', value: 'United States' },
|
||
|
{ key: 'gb', value: 'Great Britain' }
|
||
|
];
|
||
|
|
||
|
function MetadataOptions(props) {
|
||
|
const {
|
||
|
isFetching,
|
||
|
error,
|
||
|
settings,
|
||
|
hasSettings,
|
||
|
onInputChange
|
||
|
} = props;
|
||
|
|
||
|
return (
|
||
|
<FieldSet legend="Options">
|
||
|
{
|
||
|
isFetching &&
|
||
|
<LoadingIndicator />
|
||
|
}
|
||
|
|
||
|
{
|
||
|
!isFetching && error &&
|
||
|
<div>Unable to load indexer options</div>
|
||
|
}
|
||
|
|
||
|
{
|
||
|
hasSettings && !isFetching && !error &&
|
||
|
<Form>
|
||
|
<FormGroup>
|
||
|
<FormLabel>Certification Country</FormLabel>
|
||
|
|
||
|
<FormInputGroup
|
||
|
type={inputTypes.SELECT}
|
||
|
name="certificationCountry"
|
||
|
values={certificationCountryOptions}
|
||
|
onChange={onInputChange}
|
||
|
helpText="Select Country for Movie Certifications"
|
||
|
{...settings.certificationCountry}
|
||
|
/>
|
||
|
</FormGroup>
|
||
|
</Form>
|
||
|
}
|
||
|
</FieldSet>
|
||
|
);
|
||
|
}
|
||
|
|
||
|
MetadataOptions.propTypes = {
|
||
|
isFetching: PropTypes.bool.isRequired,
|
||
|
error: PropTypes.object,
|
||
|
settings: PropTypes.object.isRequired,
|
||
|
hasSettings: PropTypes.bool.isRequired,
|
||
|
onInputChange: PropTypes.func.isRequired
|
||
|
};
|
||
|
|
||
|
export default MetadataOptions;
|