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 text-2xl font-bold">Test App Page</h1>

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

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