( card: PluginCard, )
| 28 | } |
| 29 | |
| 30 | export const getButtonVariant = ( |
| 31 | card: PluginCard, |
| 32 | ): 'primary' | 'secondary' | 'danger' | 'warning' => { |
| 33 | if ( |
| 34 | card.actionType === 'requires-package' || |
| 35 | card.actionType === 'wrong-framework' || |
| 36 | card.actionType === 'version-mismatch' |
| 37 | ) |
| 38 | return 'danger' |
| 39 | if (card.actionType === 'bump-version') return 'warning' |
| 40 | if (card.actionType === 'already-installed') return 'secondary' |
| 41 | return 'primary' |
| 42 | } |
| 43 | |
| 44 | export const getBadgeClass = (card: PluginCard, styles: any): string => { |
| 45 | const s = styles() |
no outgoing calls
no test coverage detected