addons/components/Icon.tsxblame
View source
b69ab311/**
b69ab312 * Copyright (c) Meta Platforms, Inc. and affiliates.
b69ab313 *
b69ab314 * This source code is licensed under the MIT license found in the
b69ab315 * LICENSE file in the root directory of this source tree.
b69ab316 */
b69ab317
b69ab318import '@vscode/codicons/dist/codicon.css';
b69ab319import './Icon.css';
b69ab3110
b69ab3111export function Icon({
b69ab3112 icon,
b69ab3113 size,
b69ab3114 slot,
b69ab3115 color,
b69ab3116 className,
b69ab3117 ...other
b69ab3118}: {
b69ab3119 slot?: 'start';
b69ab3120 icon: string;
b69ab3121 size?: 'XS' | 'S' | 'M' | 'L';
b69ab3122 color?: 'blue' | 'red' | 'green' | 'yellow';
b69ab3123} & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>) {
b69ab3124 return (
b69ab3125 <div
b69ab3126 slot={slot}
b69ab3127 className={`codicon codicon-${icon} icon-size-${size ?? 'S'} ${
b69ab3128 color == null ? '' : `icon-${color}`
b69ab3129 } ${className ?? ''}`}
b69ab3130 {...other}
b69ab3131 />
b69ab3132 );
b69ab3133}