Replace join by Intl object
This commit is contained in:
@@ -5,7 +5,10 @@ import {jwennTeksEpiSlug, jwennTeks, jwennKomanteEpiTeksId} from '../../lib/oki-
|
||||
import TeksDrawer from '../../components/teks/teks-drawer'
|
||||
import HeadLayout from '../../components/head-layout'
|
||||
|
||||
const jwennAwtis = awtis => awtis.map(a => a.alias).join(', ')
|
||||
const jwennAwtis = awtis => {
|
||||
const alias = awtis.map(({alias}) => alias)
|
||||
return new Intl.ListFormat('fr').format(alias)
|
||||
}
|
||||
|
||||
export default function SlugTeks({teks, anTeks, slug, komante}) {
|
||||
const awtis = anTeks.awtis.length === 1 ? anTeks.awtis[0].alias : jwennAwtis(anTeks.awtis)
|
||||
|
||||
Reference in New Issue
Block a user