fix(frontend): usage of runtime config in HomePage

This commit is contained in:
Tiago Yamamoto 2025-12-31 09:42:07 -03:00
parent 4577310c75
commit e1bbd94224

View file

@ -12,19 +12,21 @@ import Link from "next/link"
import { motion } from "framer-motion"
import Image from "next/image"
import { useTranslation } from "@/lib/i18n"
import { useConfig } from "@/contexts/ConfigContext"
import { useState, useEffect } from "react"
import type { Job } from "@/lib/types"
export default function HomePage() {
const { t } = useTranslation()
const config = useConfig()
const [featuredJobs, setFeaturedJobs] = useState<Job[]>([])
const [loading, setLoading] = useState(true)
useEffect(() => {
async function fetchFeaturedJobs() {
try {
const apiBase = process.env.NEXT_PUBLIC_API_URL || "http://localhost:8521"
const apiBase = config.apiUrl
console.log("[DEBUG] API Base URL:", apiBase)
const mapJobs = (jobs: any[]): Job[] =>