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