Files
navidrome/ui/src/transcoding/TranscodingCreate.jsx
T
Deluan Quintão fcdd30ba8f build(ui): migrate from CRA/Jest to Vite/Vitest (#3311)
* feat: create vite project

* feat: it's alive!

* feat: `make dev` working!

* feat: replace custom serviceWorker with vite plugin

* test: replace Jest with Vitest

* fix: run prettier

* fix: skip eslint for now.

* chore: remove ui.old folder

* refactor: replace lodash.pick with simple destructuring

* fix: eslint errors (wip)

* fix: eslint errors (wip)

* fix: display-name eslint errors (wip)

* fix: no-console eslint errors (wip)

* fix: react-refresh/only-export-components eslint errors (wip)

* fix: react-refresh/only-export-components eslint errors (wip)

* fix: react-refresh/only-export-components eslint errors (wip)

* fix: react-refresh/only-export-components eslint errors (wip)

* fix: build

* fix: pwa manifest

* refactor: pwa manifest

* refactor: simplify PORT configuration

* refactor: rename simple JS files

* test: cover playlistUtils

* fix: react-image-lightbox

* feat(ui): add sourcemaps to help debug issues
2024-09-28 11:54:36 -04:00

52 lines
1.2 KiB
React

import React from 'react'
import {
TextInput,
SelectInput,
Create,
required,
SimpleForm,
useTranslate,
} from 'react-admin'
import { Title } from '../common'
import { BITRATE_CHOICES } from '../consts'
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}>
<SimpleForm redirect="list" variant={'outlined'}>
<TextInput source="name" validate={[required()]} />
<TextInput source="targetFormat" validate={[required()]} />
<SelectInput
source="defaultBitRate"
choices={BITRATE_CHOICES}
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