import { useEffect, useState } from "react"; import { Link } from "react-router-dom"; import { MapPin } from "lucide-react"; import { fetchLatestBrands } from "../lib/services"; import type { Brand } from "../lib/types"; import "./LatestBrands.css"; export default function LatestBrands() { const [brands, setBrands] = useState([]); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); useEffect(() => { let active = true; fetchLatestBrands(4) .then((items) => { if (active) setBrands(items); }) .catch((err: unknown) => { if (active) { setError(err instanceof Error ? err.message : "Could not load brands"); } }) .finally(() => { if (active) setLoading(false); }); return () => { active = false; }; }, []); return (
Partner directory

Latest brands

Newly featured companies ready to connect across markets and industries.

{loading ?

Loading brands…

: null} {error ? (

{error}

) : null} {!loading && !error && brands.length === 0 ? (

No published brands yet.

) : null}
{brands.map((brand) => (
{brand.imageUrl ? ( ) : (

{brand.title}

{brand.abstract ?

{brand.abstract}

: null} {[brand.city, brand.country].filter(Boolean).join(", ")}
))}
); }