PeerTube/client/src/app/shared/buttons/action-dropdown.component.ts

24 lines
633 B
TypeScript
Raw Normal View History

2018-08-08 17:36:10 +02:00
import { Component, Input } from '@angular/core'
export type DropdownAction<T> = {
label?: string
2018-10-18 14:35:31 +02:00
handler?: (a: T) => any
linkBuilder?: (a: T) => (string | number)[]
isDisplayed?: (a: T) => boolean
2018-08-08 17:36:10 +02:00
}
@Component({
selector: 'my-action-dropdown',
styleUrls: [ './action-dropdown.component.scss' ],
templateUrl: './action-dropdown.component.html'
})
export class ActionDropdownComponent<T> {
@Input() actions: DropdownAction<T>[] = []
@Input() entry: T
2018-10-08 15:15:11 +02:00
@Input() placement = 'bottom-left'
@Input() buttonSize: 'normal' | 'small' = 'normal'
2018-10-08 15:15:11 +02:00
@Input() label: string
@Input() theme: 'orange' | 'grey' = 'grey'
2018-08-08 17:36:10 +02:00
}