import AppLayout from "@/components/AppLayout";
import ChargesTable from "@/components/ChargesTable";
import Totals from "@/components/Totals";
import { getCharges, getTotals } from "@/lib/db";

// Immer frisch aus der DB lesen (kein Caching).
export const dynamic = "force-dynamic";

export default function Home() {
  const charges = getCharges();
  const totals = getTotals();

  return (
    <AppLayout>
      <h2 className="text-xl font-semibold mb-4">Ladungen</h2>
      <ChargesTable charges={charges} />
      <Totals totals={totals} />
    </AppLayout>
  );
}
