diff --git a/src/lib/components/admin/PostListItem.svelte b/src/lib/components/admin/PostListItem.svelte index 9ea61dc..72ab35d 100644 --- a/src/lib/components/admin/PostListItem.svelte +++ b/src/lib/components/admin/PostListItem.svelte @@ -2,32 +2,18 @@ import { goto } from '$app/navigation' import { createEventDispatcher, onMount } from 'svelte' import AdminByline from './AdminByline.svelte' - - interface Post { - id: number - slug: string - postType: string - title: string | null - content: any // JSON content - excerpt: string | null - status: string - tags: string[] | null - featuredImage: string | null - publishedAt: string | null - createdAt: string - updatedAt: string - } + import type { AdminPost } from '$lib/types/admin' interface Props { - post: Post + post: AdminPost } let { post }: Props = $props() const dispatch = createEventDispatcher<{ - edit: { post: Post } - togglePublish: { post: Post } - delete: { post: Post } + edit: { post: AdminPost } + togglePublish: { post: AdminPost } + delete: { post: AdminPost } }>() let isDropdownOpen = $state(false) @@ -77,7 +63,7 @@ return () => document.removeEventListener('closeDropdowns', handleCloseDropdowns) }) - function getPostSnippet(post: Post): string { + function getPostSnippet(post: AdminPost): string { // Try excerpt first if (post.excerpt) { return post.excerpt.length > 150 ? post.excerpt.substring(0, 150) + '...' : post.excerpt @@ -161,7 +147,12 @@
+ {#if selectedTypeFilter === 'all' && selectedStatusFilter === 'all'} + Create your first post to get started! + {:else} + No posts found matching the current filters. Try adjusting your filters or create a new + post. + {/if} +
+- {#if selectedTypeFilter === 'all' && selectedStatusFilter === 'all'} - Create your first post to get started! - {:else} - No posts found matching the current filters. Try adjusting your filters or create a new - post. - {/if} -
-