()
| 8 | }) |
| 9 | |
| 10 | function PostsComponent() { |
| 11 | const postsQuery = useQuery(() => postsQueryOptions) |
| 12 | |
| 13 | const posts = createMemo(() => { |
| 14 | if (postsQuery.data) { |
| 15 | return postsQuery.data |
| 16 | } else { |
| 17 | return [] |
| 18 | } |
| 19 | }) |
| 20 | |
| 21 | return ( |
| 22 | <div class="p-2 flex gap-2"> |
| 23 | <ul class="list-disc pl-4"> |
| 24 | <Suspense> |
| 25 | {[ |
| 26 | ...posts(), |
| 27 | { id: 'i-do-not-exist', title: 'Non-existent Post' }, |
| 28 | ].map((post) => { |
| 29 | return ( |
| 30 | <li class="whitespace-nowrap"> |
| 31 | <Link |
| 32 | to="/posts/$postId" |
| 33 | params={{ |
| 34 | postId: post.id, |
| 35 | }} |
| 36 | class="block py-1 px-2 text-blue-600 hover:opacity-75" |
| 37 | activeProps={{ class: 'font-bold underline' }} |
| 38 | > |
| 39 | <div>{post.title.substring(0, 20)}</div> |
| 40 | </Link> |
| 41 | </li> |
| 42 | ) |
| 43 | })} |
| 44 | </Suspense> |
| 45 | </ul> |
| 46 | <Outlet /> |
| 47 | </div> |
| 48 | ) |
| 49 | } |
nothing calls this directly
no outgoing calls
no test coverage detected