"use client";
import { use } from "react";
import type { Annunci } from "~/schemas/public/Annunci";

type AnnunciProps = {
	annunci: Promise<Pick<Annunci, "codice">[]>;
};

export default function AnnunciList({ annunci }: AnnunciProps) {
	const allAnnunci = use(annunci);

	return (
		<ul>
			{allAnnunci.map((ann) => (
				<li key={ann.codice}>{ann.codice}</li>
			))}
		</ul>
	);
}
