quintodrome/ui/src/playlist/PlaylistList.js

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

39 lines
922 B
JavaScript
Raw Normal View History

2020-05-05 14:28:55 -08:00
import React from 'react'
2020-05-08 06:47:06 -08:00
import {
BooleanField,
2020-06-05 06:22:31 -08:00
Datagrid,
2020-05-08 06:47:06 -08:00
DateField,
2020-06-05 06:22:31 -08:00
EditButton,
2020-05-16 15:14:19 -08:00
Filter,
2020-06-05 06:22:31 -08:00
NumberField,
2020-05-16 15:14:19 -08:00
SearchInput,
2020-06-05 06:22:31 -08:00
TextField,
2020-05-08 06:47:06 -08:00
} from 'react-admin'
2020-05-11 17:27:00 -08:00
import { DurationField, List } from '../common'
import Writable, { isWritable } from '../common/Writable'
2020-05-05 14:28:55 -08:00
2020-05-16 15:14:19 -08:00
const PlaylistFilter = (props) => (
<Filter {...props}>
<SearchInput source="name" alwaysOn />
</Filter>
)
2020-05-05 14:28:55 -08:00
const PlaylistList = (props) => (
2020-05-16 15:14:19 -08:00
<List {...props} exporter={false} filters={<PlaylistFilter />}>
<Datagrid rowClick="show" isRowSelectable={(r) => isWritable(r && r.owner)}>
2020-05-08 06:47:06 -08:00
<TextField source="name" />
<TextField source="owner" />
<BooleanField source="public" />
2020-05-10 15:59:47 -08:00
<NumberField source="songCount" />
2020-05-08 06:47:06 -08:00
<DurationField source="duration" />
<DateField source="updatedAt" />
2020-06-05 06:22:31 -08:00
<Writable>
<EditButton />
</Writable>
/>
2020-05-05 14:28:55 -08:00
</Datagrid>
</List>
)
export default PlaylistList