"use client" import { Company } from "@/types" import strapi from "@/app/lib/strapi" import { useState, useEffect } from "react" import Link from "next/link" export default function Companies(){ const [companies, setCompanies] = useState([]); useEffect(() => { const getCompanies = async () => { const response = await strapi("/companies", "", {}) setCompanies(response.data); }; } , [companies] ); return (
Crea
{companies.map((companies:any) =>{ return ( // eslint-disable-next-line react/jsx-key ) })}
Nome Email Numero di cellulare
{companies.id} {companies.attributes.name} {companies.attributes.email} {companies.attributes.tel}
) }