V 2.0.2 Anzahl in der Liste als const

This commit is contained in:
rxf
2026-03-06 13:37:01 +01:00
parent 0861368e4e
commit 3cc9edd4de
2 changed files with 5 additions and 3 deletions

View File

@@ -6,6 +6,8 @@ import WerteList from '@/components/WerteList';
import { WerteEntry } from '@/types/werte';
import TabLayout from '@/components/TabLayout';
const MAX_ENTRIES = 15
export default function Home() {
const [entries, setEntries] = useState<WerteEntry[]>([]);
const [isLoading, setIsLoading] = useState(true);
@@ -17,7 +19,7 @@ export default function Home() {
// Fetch initial data
(async () => {
try {
const response = await fetch('/api/werte?limit=14', {
const response = await fetch(`/api/werte?limit=${MAX_ENTRIES}`, {
cache: 'no-store',
headers: {
'Cache-Control': 'no-cache',
@@ -83,7 +85,7 @@ export default function Home() {
</div>
<div className="bg-white border border-black rounded-lg shadow-md p-6">
<h2 className="text-xl font-semibold mb-4">Letzte 14 Einträge</h2>
<h2 className="text-xl font-semibold mb-4">Letzte {MAX_ENTRIES} Einträge</h2>
{isLoading ? (
<div className="text-center py-4">Lade Daten...</div>
) : (