[Glitch] Refactor <Dropdown> into TypeScript

Port 22d33244ee to glitch-soc

Co-authored-by: Echo <ChaosExAnima@users.noreply.github.com>
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Eugen Rochko
2025-04-08 21:22:19 +02:00
committed by Claire
parent f86148f324
commit 4cb9d6b333
21 changed files with 851 additions and 652 deletions

View File

@@ -3,16 +3,18 @@ interface BaseMenuItem {
dangerous?: boolean;
}
interface ActionMenuItem extends BaseMenuItem {
export interface ActionMenuItem extends BaseMenuItem {
action: () => void;
}
interface LinkMenuItem extends BaseMenuItem {
export interface LinkMenuItem extends BaseMenuItem {
to: string;
}
interface ExternalLinkMenuItem extends BaseMenuItem {
export interface ExternalLinkMenuItem extends BaseMenuItem {
href: string;
target?: string;
method?: 'post' | 'put' | 'delete';
}
export type MenuItem =
@@ -20,5 +22,3 @@ export type MenuItem =
| LinkMenuItem
| ExternalLinkMenuItem
| null;
export type DropdownMenu = MenuItem[];