import { Suspense } from "react";
import { getDataFromDB } from "~/_app/lib/annunci";
import AnnunciList from "~/_app/ui/annunci";
import { LoadingPage } from "~/components/loading";

export default function TestAppPage() {
	const annunci = getDataFromDB();

	return (
		<div className="p-8">
			<h1 className="mb-4 font-bold text-2xl">Test App Page</h1>

			<div className="rounded-lg border bg-gray-50 p-4">
				<h2 className="mb-2 font-semibold text-lg">Data from Database:</h2>

				<Suspense fallback={<LoadingPage />}>
					<AnnunciList annunci={annunci} />
				</Suspense>
			</div>
		</div>
	);
}
