quintodrome/ui/src/transcoding/TranscodingCreate.jsx

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

52 lines
1.2 KiB
React
Raw Normal View History

import React from 'react'
import {
TextInput,
SelectInput,
Create,
required,
SimpleForm,
2020-04-27 19:22:17 -08:00
useTranslate,
} from 'react-admin'
import { Title } from '../common'
import { BITRATE_CHOICES } from '../consts'
2020-04-27 19:22:17 -08:00
const TranscodingTitle = () => {
const translate = useTranslate()
const resourceName = translate('resources.transcoding.name', {
smart_count: 1,
})
const title = translate('ra.page.create', {
name: `${resourceName}`,
})
return <Title subTitle={title} />
}
const TranscodingCreate = (props) => (
<Create title={<TranscodingTitle />} {...props}>
2023-01-24 16:58:20 -09:00
<SimpleForm redirect="list" variant={'outlined'}>
<TextInput source="name" validate={[required()]} />
<TextInput source="targetFormat" validate={[required()]} />
<SelectInput
source="defaultBitRate"
choices={BITRATE_CHOICES}
2020-04-03 17:03:34 -08:00
defaultValue={192}
/>
<TextInput
source="command"
fullWidth
validate={[required()]}
helperText={
<span>
Substitutions: <br />
%s: File path <br />
%b: BitRate (in kbps)
<br />
</span>
}
/>
</SimpleForm>
</Create>
)
export default TranscodingCreate