quintodrome/ui/src/transcoding/TranscodingEdit.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.5 KiB
JavaScript
Raw Normal View History

import React from 'react'
2020-04-27 19:22:17 -08:00
import {
Edit,
required,
2020-04-29 07:58:42 -08:00
SelectInput,
2020-04-27 19:22:17 -08:00
SimpleForm,
2020-04-29 07:58:42 -08:00
TextInput,
2020-04-27 19:22:17 -08:00
useTranslate,
} from 'react-admin'
import { Title } from '../common'
2020-04-29 07:58:42 -08:00
import { TranscodingNote } from './TranscodingNote'
const TranscodingTitle = ({ record }) => {
2020-04-27 19:22:17 -08:00
const translate = useTranslate()
const resourceName = translate('resources.transcoding.name', {
smart_count: 1,
})
return <Title subTitle={`${resourceName} ${record ? record.name : ''}`} />
}
2020-04-29 07:58:42 -08:00
const TranscodingEdit = (props) => {
return (
<>
<TranscodingNote message={'message.transcodingEnabled'} />
<Edit title={<TranscodingTitle />} {...props}>
<SimpleForm>
<TextInput source="name" validate={[required()]} />
<TextInput source="targetFormat" validate={[required()]} />
<SelectInput
source="defaultBitRate"
choices={[
{ id: 32, name: '32' },
{ id: 48, name: '48' },
{ id: 64, name: '64' },
{ id: 80, name: '80' },
{ id: 96, name: '96' },
{ id: 112, name: '112' },
{ id: 128, name: '128' },
{ id: 160, name: '160' },
{ id: 192, name: '192' },
{ id: 256, name: '256' },
{ id: 320, name: '320' },
]}
/>
<TextInput source="command" fullWidth validate={[required()]} />
</SimpleForm>
</Edit>
</>
)
}
export default TranscodingEdit