Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| PageMain takes the attributes a main and a div share, so the full typecheck passes | 1 | import { type HTMLAttributes, createContext, useContext } from "react"; |
| Not found and error pages have one main landmark: their own when signed out, the shell's when signed in | 2 | |
| 3 | /** True inside the app shell, whose `<main id="content">` already holds the page. */ | |
| 4 | export const InMain = createContext(false); | |
| 5 | ||
| 6 | /** | |
| 7 | * A page's main landmark: `<main>` where nothing above is one (signed out), | |
| 8 | * a plain `<div>` inside the shell, so a page never has two. | |
| 9 | */ | |
| PageMain takes the attributes a main and a div share, so the full typecheck passes | 10 | export function PageMain(props: HTMLAttributes<HTMLElement>) { |
| Not found and error pages have one main landmark: their own when signed out, the shell's when signed in | 11 | return useContext(InMain) ? <div {...props} /> : <main {...props} />; |
| 12 | } |