mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-14 11:17:19 +03:00
Only show auto-import info for auto-imported playlists
This commit is contained in:
parent
178e42487b
commit
41138bd665
@ -1,6 +1,8 @@
|
||||
import React from 'react'
|
||||
import React, { Fragment } from 'react'
|
||||
|
||||
import {
|
||||
Edit,
|
||||
FormDataConsumer,
|
||||
SimpleForm,
|
||||
TextInput,
|
||||
TextField,
|
||||
@ -8,14 +10,24 @@ import {
|
||||
required,
|
||||
} from 'react-admin'
|
||||
|
||||
const SyncFragment = ({ formData, ...rest }) => {
|
||||
return (
|
||||
<Fragment>
|
||||
{formData.path && <BooleanInput source="sync" {...rest} />}
|
||||
{formData.path && <TextField source="path" {...rest} />}
|
||||
</Fragment>
|
||||
)
|
||||
}
|
||||
|
||||
const PlaylistEdit = (props) => (
|
||||
<Edit {...props}>
|
||||
<SimpleForm redirect="list">
|
||||
<TextInput source="name" validate={required()} />
|
||||
<TextInput multiline source="comment" />
|
||||
<BooleanInput source="public" />
|
||||
<BooleanInput source="sync" />
|
||||
<TextField source="path" />
|
||||
<FormDataConsumer>
|
||||
{(formDataProps) => <SyncFragment {...formDataProps} />}
|
||||
</FormDataConsumer>
|
||||
</SimpleForm>
|
||||
</Edit>
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user