|
| 1 | +/** |
| 2 | + * Copyright (c) Microsoft Corporation. All rights reserved. |
| 3 | + * Licensed under the MIT License. |
| 4 | + */ |
| 5 | + |
| 6 | +export interface ButtonStyles { |
| 7 | + backgroundColor: string; |
| 8 | + border: string; |
| 9 | + color: string; |
| 10 | + borderRadius: string; |
| 11 | +} |
| 12 | + |
| 13 | +const BUTTON_STYLE_MAP: Record<string, ButtonStyles> = { |
| 14 | + Documentation: { |
| 15 | + backgroundColor: "#ECF9FF", |
| 16 | + border: "1px solid #AED4F2", |
| 17 | + color: "#0078D4", |
| 18 | + borderRadius: "3px 3px 14px 14px", |
| 19 | + }, |
| 20 | + "Solution Accelerator": { |
| 21 | + backgroundColor: "#F1FBF1", |
| 22 | + border: "1px solid #B7D8B7", |
| 23 | + color: "#107C10", |
| 24 | + borderRadius: "3px 3px 14px 14px", |
| 25 | + }, |
| 26 | + Video: { |
| 27 | + backgroundColor: "#FEF7EE", |
| 28 | + border: "1px solid #DDC4A2", |
| 29 | + color: "#CE811D", |
| 30 | + borderRadius: "3px 3px 14px 14px", |
| 31 | + }, |
| 32 | + Training: { |
| 33 | + backgroundColor: "#FAF4FF", |
| 34 | + border: "1px solid #CDBFDE", |
| 35 | + color: "#5C2D91", |
| 36 | + borderRadius: "3px 3px 14px 14px", |
| 37 | + }, |
| 38 | + Workshop: { |
| 39 | + backgroundColor: "#FAF4FF", |
| 40 | + border: "1px solid #CDBFDE", |
| 41 | + color: "#5C2D91", |
| 42 | + borderRadius: "3px 3px 14px 14px", |
| 43 | + }, |
| 44 | + Blog: { |
| 45 | + backgroundColor: "#FFEFFD", |
| 46 | + border: "1px solid #E6B9E1", |
| 47 | + color: "#B140A3", |
| 48 | + borderRadius: "3px 3px 14px 14px", |
| 49 | + }, |
| 50 | +}; |
| 51 | + |
| 52 | +const DEFAULT_BUTTON_STYLES: ButtonStyles = { |
| 53 | + backgroundColor: "#ECF9FF", |
| 54 | + border: "1px solid #AED4F2", |
| 55 | + color: "#0078D4", |
| 56 | + borderRadius: "3px 3px 14px 14px", |
| 57 | +}; |
| 58 | + |
| 59 | +/** |
| 60 | + * Returns CTA button styles (background, border, text color, border-radius) based on button text. |
| 61 | + */ |
| 62 | +export function getButtonStyles(buttonText: string): ButtonStyles { |
| 63 | + return BUTTON_STYLE_MAP[buttonText] ?? DEFAULT_BUTTON_STYLES; |
| 64 | +} |
0 commit comments