]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/shared/buttons/action-dropdown.component.ts
Add user moderation in the account page
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / buttons / action-dropdown.component.ts
CommitLineData
eacb25c4
C
1import { Component, Input } from '@angular/core'
2
3export type DropdownAction<T> = {
eacb25c4
C
4 label?: string
5 handler?: (T) => any
6 linkBuilder?: (T) => (string | number)[]
141b177d 7 isDisplayed?: (T) => boolean
eacb25c4
C
8}
9
10@Component({
11 selector: 'my-action-dropdown',
12 styleUrls: [ './action-dropdown.component.scss' ],
13 templateUrl: './action-dropdown.component.html'
14})
15
16export class ActionDropdownComponent<T> {
17 @Input() actions: DropdownAction<T>[] = []
18 @Input() entry: T
141b177d 19 @Input() placement = 'left'
79bd2632 20 @Input() buttonSize: 'normal' | 'small' = 'normal'
eacb25c4 21}