| 1 | | − | import { type ComponentProps, createContext, useContext } from "react"; |
| 1 | + | import { type HTMLAttributes, createContext, useContext } from "react"; |
| 2 | 2 | | |
| 3 | 3 | | /** True inside the app shell, whose `<main id="content">` already holds the page. */ |
| 4 | 4 | | export const InMain = createContext(false); |
| ⋯ |
| 7 | 7 | | * A page's main landmark: `<main>` where nothing above is one (signed out), |
| 8 | 8 | | * a plain `<div>` inside the shell, so a page never has two. |
| 9 | 9 | | */ |
| 10 | | − | export function PageMain(props: ComponentProps<"main">) { |
| 10 | + | export function PageMain(props: HTMLAttributes<HTMLElement>) { |
| 11 | 11 | | return useContext(InMain) ? <div {...props} /> : <main {...props} />; |
| 12 | 12 | | } |