V 2.0.2 Anzahl in der Liste als const
This commit is contained in:
@@ -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>
|
||||
) : (
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "werte_next",
|
||||
"version": "2.0.1",
|
||||
"version": "2.0.2",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
||||
Reference in New Issue
Block a user