1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00
Files
tooot/src/components/contextMenu/index.d.ts
xmflsct 6ce78e94f8 Fix #271
Added follow as menu option
2023-01-08 16:59:35 +01:00

54 lines
964 B
TypeScript

// type ContextMenu = (
// | {
// type: 'group'
// key: string
// items: ContextMenuItem[]
// }
// | {
// type: 'sub'
// key: string
// trigger: {
// key: string
// props: {
// disabled: boolean
// destructive: boolean
// hidden: boolean
// }
// title: string
// icon?: string
// }
// items: ContextMenuItem[]
// }
// )[]
type ContextMenu = (ContextMenuItem | ContextMenuSub)[][]
type ContextMenuItem = {
type: 'item'
key: string
props: {
onSelect: () => void
disabled: boolean
destructive: boolean
hidden: boolean
}
title: string
icon?: string
}
type ContextMenuSub = {
type: 'sub'
key: string
trigger: {
key: string
props: {
disabled: boolean
destructive: boolean
hidden: boolean
}
title: string
icon?: string
}
items: Omit<ContextMenuItem, 'type'>[]
}