Replace join by Intl object

This commit is contained in:
Cédric FAMIBELLE-PRONZOLA
2022-02-05 14:21:56 +04:00
parent 3f487c5aa4
commit a7a9b15b59
6 changed files with 13 additions and 6 deletions
+2 -1
View File
@@ -58,6 +58,7 @@ export default function Lekte({audio, url, teks}) {
const [position, setPosition] = useState(0)
const [volume, setVolume] = useState(100)
const [isPlaying, setIsPlaying] = useState(false)
const awtis = teks.awtis.map(({alias}) => alias)
function formatDuration(value) {
const minute = Math.floor(value / 60)
@@ -146,7 +147,7 @@ export default function Lekte({audio, url, teks}) {
</CoverImage>
<Box sx={{ml: 1.5, minWidth: 0}}>
<Typography fontWeight={500}>
{teks.awtis.map(a => a.alias).join(', ')}
{new Intl.ListFormat('fr').format(awtis)}
</Typography>
<Typography>
<Link underline='hover' sx={{cursor: 'pointer'}} target='_blank' rel='noreferrer' href={url}>