Adapt components with API response

This commit is contained in:
2026-04-21 19:16:11 +04:00
parent 0a96b20a85
commit 6b94f95bb8
22 changed files with 123 additions and 124 deletions
+2 -2
View File
@@ -50,10 +50,10 @@ export default function Pataje({parole, setError, setSuccess}) {
const [open, setOpen] = useState(false)
const patajeUrl = `${SITE_URL}/paroles/${slug}`
const alias = artistes.data.map(({attributes}) => attributes.alias)
const alias = artistes.map(({alias}) => alias)
const renderAwtis = new Intl.ListFormat('fr').format(alias)
const text = parole.user.data || parole.userAdmin.data ? `${renderAwtis} - ${titre} (Paroles et Traductions) - (parole soumise par ${parole?.user?.data?.attributes?.username || parole.userAdmin?.data?.attributes?.username || parole.userAdmin?.data?.attributes?.firstname})` : `${renderAwtis} - ${titre} (Paroles et Traductions)`
const text = parole.user || parole.userAdmin ? `${renderAwtis} - ${titre} (Paroles et Traductions) - (parole soumise par ${parole?.user?.username || parole.userAdmin?.username || parole.userAdmin?.firstname})` : `${renderAwtis} - ${titre} (Paroles et Traductions)`
const handleClose = () => {
setOpen(false)