'use client' import Image from 'next/image'; import { CopyPlus, Trash2, Plus } from 'lucide-react'; import { useState } from 'react'; import { Button } from '@/components/ui/button'; interface Card { id: number; isEditing: boolean; } export default function Frame() { const [cards, setCards] = useState([]); const [nextId, setNextId] = useState(1); const handleAddCard = () => { setCards([...cards, { id: nextId, isEditing: true }]); setNextId(nextId + 1); }; const handleDeleteCard = (id: number) => { setCards(cards.filter(card => card.id !== id)); }; const totalPages = cards.length + 1; return (
Page 1/{totalPages}
handleDeleteCard(0)} />
Excerpt Card
{cards.map((card, index) => (
Page {index + 2}/{totalPages}
handleDeleteCard(card.id)} />
))}
); }