import type { Icon, IconProps } from '@phosphor-icons/react'; import type { MIMETypeValue } from '@shared/types/MIMEType'; 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; style?: React.CSSProperties; variant?: 'filled' | 'outline' | 'minimal'; size?: 'regular' | 'small' | 'mini'; onChange?: (event: React.ChangeEvent) => void; icon?: Icon; iconProps?: IconProps; disabled?: boolean; title?: string; color: ThemeColor; accept?: MIMETypeValue | MIMETypeValue[]; } /** * A reusable input button component that follows the Button.tsx consistency * * @returns */ export default function FileUpload({ className, style, variant = 'filled', size = 'regular', onChange, icon, iconProps, disabled, title, color, accept, children, }: React.PropsWithChildren): JSX.Element { const Icon = icon; const isIconOnly = !children && !!icon; const colorHex = getThemeColorHexByName(color); const colorRgb = getThemeColorRgbByName(color)?.join(' '); // Convert accept to a comma-separated string if it's an array const acceptValue = Array.isArray(accept) ? accept.join(',') : accept; return ( ); }