SquidSpirit 5890d6c39c
Some checks failed
Frontend CI / build (push) Failing after 1m13s
Auto Comment On PR / add_improve_comment (pull_request) Successful in 17s
PR Title Check / pr-title-check (pull_request) Successful in 16s
feat: enhance post listing functionality with unpublished post visibility option
2025-10-15 04:06:11 +08:00

22 lines
959 B
Svelte

<script lang="ts">
import { Container } from '$lib/container';
import { PostCreatedStore } from '$lib/post/adapter/presenter/postCreatedStore';
import { PostsListedStore } from '$lib/post/adapter/presenter/postsListedStore';
import PostManagementPage from '$lib/post/framework/ui/PostManagementPage.svelte';
import { getContext, setContext } from 'svelte';
import type { PageProps } from './$types';
import { PostInfoViewModel } from '$lib/post/adapter/presenter/postInfoViewModel';
const { data }: PageProps = $props();
const container = getContext<Container>(Container.name);
const postCreatedStore = container.createPostCreatedStore();
setContext(PostCreatedStore.name, postCreatedStore);
const initialData = data.dehydratedData?.map((post) => PostInfoViewModel.rehydrate(post));
const postsListedStore = container.createPostsListedStore(initialData);
setContext(PostsListedStore.name, postsListedStore);
</script>
<PostManagementPage />