diff --git a/tauri-app/src/pages/ContentManagement/MyWorks.tsx b/tauri-app/src/pages/ContentManagement/MyWorks.tsx index a1c8262..99ab562 100644 --- a/tauri-app/src/pages/ContentManagement/MyWorks.tsx +++ b/tauri-app/src/pages/ContentManagement/MyWorks.tsx @@ -46,7 +46,7 @@ const tabs = [ { id: 'drafts' as TabType, label: '草稿箱' }, ]; -const PAGE_SIZE = 8; + function formatDateFriendly(timestamp: number): string { const date = new Date(timestamp); @@ -67,21 +67,6 @@ function formatFileSize(bytes: number): string { return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`; } -function Pagination({ current, total, onChange }: { current: number; total: number; onChange: (page: number) => void }) { - if (total <= 1) {return null;} - return ( -
-
- - {Array.from({ length: total }, (_, i) => i + 1).map(page => ( - - ))} - -
-
- ); -} - function formatDuration(seconds: number): string { if (seconds <= 0) {return '';} const mins = Math.floor(seconds / 60); @@ -295,8 +280,7 @@ export default function MyWorks() { const [showDeleteDraftModal, setShowDeleteDraftModal] = useState(false); const [deletingDraft, setDeletingDraft] = useState(null); const [isDeletingDraft, setIsDeletingDraft] = useState(false); - const [productPage, setProductPage] = useState(1); - const [draftPage, setDraftPage] = useState(1); + const [editingDraftId, setEditingDraftId] = useState(null); const [editDraftTitle, setEditDraftTitle] = useState(''); const { navigate } = useNavigation(); @@ -387,11 +371,7 @@ export default function MyWorks() { setEditingDraftId(null); }; - const totalProductPages = Math.ceil(products.length / PAGE_SIZE); - const paginatedProducts = products.slice((productPage - 1) * PAGE_SIZE, productPage * PAGE_SIZE); - const totalDraftPages = Math.ceil(drafts.length / PAGE_SIZE); - const paginatedDrafts = drafts.slice((draftPage - 1) * PAGE_SIZE, draftPage * PAGE_SIZE); return (
@@ -417,9 +397,9 @@ export default function MyWorks() { <> {activeTab === 'products' && ( <> - {paginatedProducts.length > 0 ? ( -
- {paginatedProducts.map(product => ( + {products.length > 0 ? ( +
+ {products.map(product => ( ))}
@@ -430,15 +410,15 @@ export default function MyWorks() {

完成压制成片后会保存在这里

)} - + )} {activeTab === 'drafts' && ( <>
- {paginatedDrafts.length > 0 ? ( -
- {paginatedDrafts.map(draft => ( + {drafts.length > 0 ? ( +
+ {drafts.map(draft => ( )}
- + )}