feat: enhance post creation feedback and improve table layout in Post Management

This commit is contained in:
SquidSpirit 2025-10-15 07:02:05 +08:00
parent a577f94acd
commit aed4102878

View File

@ -26,6 +26,7 @@
const state = await createPost(params);
if (state.isSuccess()) {
loadPosts({ showUnpublished: true });
toast.success(`Post created successfully with ID: ${state.data.id}`);
} else if (state.isError()) {
toast.error('Failed to create post', {
@ -56,13 +57,15 @@
{#each postsListedState.data as postInfo (postInfo.id)}
<TableRow>
<TableCell>{postInfo.id}</TableCell>
<TableCell>{postInfo.title}</TableCell>
<TableCell class="flex flex-row flex-wrap gap-2">
<TableCell><span class="text-wrap">{postInfo.title}</span></TableCell>
<TableCell>
<div class="flex flex-row flex-wrap gap-2">
{#each postInfo.labels as label (label.id)}
<PostLabel {label} />
{/each}
</div>
</TableCell>
<TableCell>{postInfo.formattedPublishedTime || '---'}</TableCell>
<TableCell>{postInfo.formattedPublishedTime}</TableCell>
</TableRow>
{/each}
{/if}