(card: PluginCard, styles: any)
| 42 | } |
| 43 | |
| 44 | export const getBadgeClass = (card: PluginCard, styles: any): string => { |
| 45 | const s = styles() |
| 46 | const base = s.pluginMarketplaceCardBadge |
| 47 | switch (card.actionType) { |
| 48 | case 'install': |
| 49 | case 'install-devtools': |
| 50 | return `${base} ${s.pluginMarketplaceCardBadgeInstall}` |
| 51 | case 'add-to-devtools': |
| 52 | return `${base} ${s.pluginMarketplaceCardBadgeAdd}` |
| 53 | // Active matches the green rule down the card's leading edge, so the two |
| 54 | // signals for "this one is running" agree instead of using two colours. |
| 55 | case 'already-installed': |
| 56 | return `${base} ${s.pluginMarketplaceCardBadgeActive}` |
| 57 | case 'bump-version': |
| 58 | case 'version-mismatch': |
| 59 | return `${base} ${s.pluginMarketplaceCardBadgeBlocked}` |
| 60 | case 'requires-package': |
| 61 | case 'wrong-framework': |
| 62 | return `${base} ${s.pluginMarketplaceCardBadgeRequires}` |
| 63 | default: |
| 64 | return base |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | export const getBadgeText = (card: PluginCard): string => { |
no outgoing calls
no test coverage detected