Refactor <Header> into TypeScript (#33956)

This commit is contained in:
Eugen Rochko 2025-02-25 16:30:46 +01:00 committed by GitHub
parent 20531d1e07
commit ebde60ca82
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 1121 additions and 859 deletions

View file

@ -0,0 +1,24 @@
interface BaseMenuItem {
text: string;
dangerous?: boolean;
}
interface ActionMenuItem extends BaseMenuItem {
action: () => void;
}
interface LinkMenuItem extends BaseMenuItem {
to: string;
}
interface ExternalLinkMenuItem extends BaseMenuItem {
href: string;
}
export type MenuItem =
| ActionMenuItem
| LinkMenuItem
| ExternalLinkMenuItem
| null;
export type DropdownMenu = MenuItem[];