1
0
Fork 0
forked from gitea/nas

Refactor <Dropdown> into TypeScript (#34357)

Co-authored-by: Echo <ChaosExAnima@users.noreply.github.com>
This commit is contained in:
Eugen Rochko 2025-04-08 21:22:19 +02:00 committed by GitHub
parent b7c3235349
commit 22d33244ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 846 additions and 654 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[];