]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/shared/buttons/action-dropdown.component.ts
407d24b80f31f7c321a153bb76bda6bd5fc8495e
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / buttons / action-dropdown.component.ts
1 import { Component, Input } from '@angular/core'
2
3 export type DropdownAction<T> = {
4 type: 'custom' | 'delete' | 'edit'
5 label?: string
6 handler?: (T) => any
7 linkBuilder?: (T) => (string | number)[]
8 iconClass?: string
9 }
10
11 @Component({
12 selector: 'my-action-dropdown',
13 styleUrls: [ './action-dropdown.component.scss' ],
14 templateUrl: './action-dropdown.component.html'
15 })
16
17 export class ActionDropdownComponent<T> {
18 @Input() actions: DropdownAction<T>[] = []
19 @Input() entry: T
20 }