| b69ab31 | | | 1 | /** |
| b69ab31 | | | 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| b69ab31 | | | 3 | * |
| b69ab31 | | | 4 | * This source code is licensed under the MIT license found in the |
| b69ab31 | | | 5 | * LICENSE file in the root directory of this source tree. |
| b69ab31 | | | 6 | */ |
| b69ab31 | | | 7 | |
| b69ab31 | | | 8 | import '@vscode/codicons/dist/codicon.css'; |
| b69ab31 | | | 9 | import './Icon.css'; |
| b69ab31 | | | 10 | |
| b69ab31 | | | 11 | export function Icon({ |
| b69ab31 | | | 12 | icon, |
| b69ab31 | | | 13 | size, |
| b69ab31 | | | 14 | slot, |
| b69ab31 | | | 15 | color, |
| b69ab31 | | | 16 | className, |
| b69ab31 | | | 17 | ...other |
| b69ab31 | | | 18 | }: { |
| b69ab31 | | | 19 | slot?: 'start'; |
| b69ab31 | | | 20 | icon: string; |
| b69ab31 | | | 21 | size?: 'XS' | 'S' | 'M' | 'L'; |
| b69ab31 | | | 22 | color?: 'blue' | 'red' | 'green' | 'yellow'; |
| b69ab31 | | | 23 | } & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>) { |
| b69ab31 | | | 24 | return ( |
| b69ab31 | | | 25 | <div |
| b69ab31 | | | 26 | slot={slot} |
| b69ab31 | | | 27 | className={`codicon codicon-${icon} icon-size-${size ?? 'S'} ${ |
| b69ab31 | | | 28 | color == null ? '' : `icon-${color}` |
| b69ab31 | | | 29 | } ${className ?? ''}`} |
| b69ab31 | | | 30 | {...other} |
| b69ab31 | | | 31 | /> |
| b69ab31 | | | 32 | ); |
| b69ab31 | | | 33 | } |