2020-01-22 09:02:19 -09:00
|
|
|
import React from 'react'
|
|
|
|
|
import {
|
|
|
|
|
Datagrid,
|
|
|
|
|
Filter,
|
|
|
|
|
NumberField,
|
|
|
|
|
SearchInput,
|
|
|
|
|
TextField,
|
|
|
|
|
} from 'react-admin'
|
2020-05-15 06:20:11 -08:00
|
|
|
import { artistLink, List } from '../common'
|
2020-01-22 09:02:19 -09:00
|
|
|
|
|
|
|
|
const ArtistFilter = (props) => (
|
|
|
|
|
<Filter {...props}>
|
|
|
|
|
<SearchInput source="name" alwaysOn />
|
|
|
|
|
</Filter>
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const ArtistList = (props) => (
|
|
|
|
|
<List
|
|
|
|
|
{...props}
|
2020-04-24 13:37:28 -08:00
|
|
|
sort={{ field: 'name', order: 'ASC' }}
|
2020-01-22 09:02:19 -09:00
|
|
|
exporter={false}
|
|
|
|
|
bulkActionButtons={false}
|
|
|
|
|
filters={<ArtistFilter />}
|
|
|
|
|
>
|
2020-05-14 16:42:21 -08:00
|
|
|
<Datagrid rowClick={artistLink}>
|
2020-04-24 13:37:28 -08:00
|
|
|
<TextField source="name" />
|
2020-01-22 09:02:19 -09:00
|
|
|
<NumberField source="albumCount" />
|
2020-05-08 05:50:33 -08:00
|
|
|
<NumberField source="songCount" />
|
2020-01-22 09:02:19 -09:00
|
|
|
</Datagrid>
|
|
|
|
|
</List>
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
export default ArtistList
|