quintodrome/ui/src/album/AlbumShow.js

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

41 lines
1,007 B
JavaScript
Raw Normal View History

import React from 'react'
2020-04-09 14:31:37 -08:00
import { useGetOne } from 'react-admin'
2020-02-07 11:04:45 -09:00
import AlbumDetails from './AlbumDetails'
import { Title } from '../common'
import { SongBulkActions } from '../common'
2020-05-15 09:48:33 -08:00
import AlbumActions from './AlbumActions'
import AlbumSongs from './AlbumSongs'
const AlbumShow = (props) => {
const { data: record, loading, error } = useGetOne('album', props.id)
if (loading) {
return null
}
if (error) {
return <p>ERROR: {error}</p>
}
return (
<>
2020-11-13 17:11:24 -09:00
<AlbumDetails {...props} record={record} />
<AlbumSongs
{...props}
albumId={props.id}
title={<Title subTitle={record.name} />}
2020-09-06 07:54:30 -08:00
actions={<AlbumActions record={record} />}
filter={{ album_id: props.id }}
resource={'albumSong'}
exporter={false}
perPage={0}
pagination={null}
sort={{ field: 'discNumber asc, trackNumber asc', order: 'ASC' }}
bulkActionButtons={<SongBulkActions />}
/>
</>
)
}
export default AlbumShow