Add Genres as "Chips" in Album details and Song details

This commit is contained in:
Deluan 2021-07-17 13:15:32 -04:00 committed by Deluan Quintão
parent e2233779f1
commit 054b5eafdb
12 changed files with 171 additions and 98 deletions

View file

@ -2,18 +2,19 @@ import React, { memo } from 'react'
import Typography from '@material-ui/core/Typography'
import sanitizeFieldRestProps from './sanitizeFieldRestProps'
import md5 from 'blueimp-md5'
import { useRecordContext } from 'react-admin'
export const MultiLineTextField = memo(
({
className,
emptyText,
source,
record,
firstLine,
maxLines,
addLabel,
...rest
}) => {
const record = useRecordContext(rest)
const value = record && record[source]
let lines = value ? value.split('\n') : []
if (maxLines || firstLine) {
@ -46,7 +47,6 @@ export const MultiLineTextField = memo(
)
MultiLineTextField.defaultProps = {
record: {},
addLabel: true,
firstLine: 0,
}