()
| 5 | }) |
| 6 | |
| 7 | function PostsLayoutComponent() { |
| 8 | const posts = Route.useLoaderData() |
| 9 | |
| 10 | return ( |
| 11 | <div class="p-2 flex gap-2"> |
| 12 | <ul class="list-disc pl-4"> |
| 13 | {[...posts(), { id: 'i-do-not-exist', title: 'Non-existent Post' }].map( |
| 14 | (post) => { |
| 15 | return ( |
| 16 | <li class="whitespace-nowrap"> |
| 17 | <Link |
| 18 | to="/posts/$postId" |
| 19 | params={{ |
| 20 | postId: post.id, |
| 21 | }} |
| 22 | class="block py-1 px-2 text-blue-600 hover:opacity-75" |
| 23 | activeProps={{ class: 'font-bold underline' }} |
| 24 | > |
| 25 | <div>{post.title.substring(0, 20)}</div> |
| 26 | </Link> |
| 27 | </li> |
| 28 | ) |
| 29 | }, |
| 30 | )} |
| 31 | </ul> |
| 32 | <Outlet /> |
| 33 | </div> |
| 34 | ) |
| 35 | } |
nothing calls this directly
no outgoing calls
no test coverage detected