import type { Icon, IconProps } from '@phosphor-icons/react'; import type { ThemeColor } from '@shared/types/ThemeColors'; import { getThemeColorHexByName, getThemeColorRgbByName } from '@shared/util/themeColors'; import Text from '@views/components/common/Text/Text'; import clsx from 'clsx'; import React from 'react'; interface Props { className?: string; ref?: React.ForwardedRef; style?: React.CSSProperties; variant?: 'filled' | 'outline' | 'minimal'; size?: 'regular' | 'small' | 'mini'; onClick?: (event: React.MouseEvent) => void; icon?: Icon; iconProps?: IconProps; disabled?: boolean; title?: string; color: ThemeColor; } /** * A reusable button component that follows the design system of the extension. * @returns */ export function Button({ className, ref, style, variant = 'filled', size = 'regular', onClick, icon, iconProps, disabled, title, color, children, }: React.PropsWithChildren): JSX.Element { const Icon = icon; const isIconOnly = !children && !!icon; const colorHex = getThemeColorHexByName(color); const colorRgb = getThemeColorRgbByName(color)?.join(' '); return ( ); }