2020-01-22 10:19:13 -05:00
|
|
|
import React from 'react'
|
2020-02-07 12:36:26 -05:00
|
|
|
import { useMediaQuery } from '@material-ui/core'
|
2020-04-27 23:22:17 -04:00
|
|
|
import { useTranslate } from 'react-admin'
|
2020-01-22 10:19:13 -05:00
|
|
|
|
2020-11-10 19:27:28 -05:00
|
|
|
export const Title = ({ subTitle, args }) => {
|
2020-04-27 23:22:17 -04:00
|
|
|
const translate = useTranslate()
|
2020-02-07 12:36:26 -05:00
|
|
|
const isDesktop = useMediaQuery((theme) => theme.breakpoints.up('md'))
|
2020-04-27 23:22:17 -04:00
|
|
|
const text = translate(subTitle, { ...args, _: subTitle })
|
2020-02-07 12:36:26 -05:00
|
|
|
|
|
|
|
|
if (isDesktop) {
|
2020-04-27 23:22:17 -04:00
|
|
|
return <span>Navidrome {text ? ` - ${text}` : ''}</span>
|
2020-02-07 12:36:26 -05:00
|
|
|
}
|
2020-04-27 23:22:17 -04:00
|
|
|
return <span>{text ? text : 'Navidrome'}</span>
|
2020-01-22 10:19:13 -05:00
|
|
|
}
|