import { OpaqueColorValue, type StyleProp, type TextStyle } from 'react-native';
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
import React from 'react';
import { useThemeColor } from '../../lib/hooks/use-theme-color';

export type IconSymbolName =
  | 'home'
  | 'chat-bubble'
  | 'send'
  | 'code'
  | 'chevron-right'
  | 'file-upload'
  | 'settings';

export function IconSymbol({
  name,
  size = 24,
  color,
  style,
}: {
  name: IconSymbolName;
  size?: number;
  color?: string | OpaqueColorValue;
  style?: StyleProp<TextStyle>;
}) {
  const iconColor = color ?? useThemeColor("text")
  return <MaterialIcons color={iconColor} size={size} name={name} style={style} />;
}