/opt/canhelp/apps/web/src/components
Edit: /opt/canhelp/apps/web/src/components/Footer.tsx (3019B)
'use client'
import { useLocale } from '@/context/locale'
import { useEffect, useState } from 'react'
import Link from 'next/link'
import { SocialIcons } from './SocialIcons'
const API = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'
export function Footer() {
const { t } = useLocale()
const year = new Date().getFullYear()
const [socialLinks, setSocialLinks] = useState
>({})
useEffect(() => {
fetch(`${API}/api/admin/social-public`)
.then((r) => r.ok ? r.json() : {})
.then((kv: Record) => {
const links: Record = {}
for (const [k, v] of Object.entries(kv)) {
if (v) links[k.replace('social.', '')] = v
}
setSocialLinks(links)
})
.catch(() => {})
}, [])
return (
)
}