managarten/manadeck/apps/mobile/components/ui/Icon.tsx
Till-JS e7f5f942f3 chore: initial commit - consolidate 4 projects into monorepo
Projects included:
- maerchenzauber (NestJS backend + Expo mobile + SvelteKit web + Astro landing)
- manacore (Expo mobile + SvelteKit web + Astro landing)
- manadeck (NestJS backend + Expo mobile + SvelteKit web)
- memoro (Expo mobile + SvelteKit web + Astro landing)

This commit preserves the current state before monorepo restructuring.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 23:38:24 +01:00

40 lines
964 B
TypeScript

import React from 'react';
import { FontAwesome, Ionicons, MaterialIcons, Feather } from '@expo/vector-icons';
import { StyleProp, ViewStyle } from 'react-native';
type IconLibrary = 'FontAwesome' | 'Ionicons' | 'MaterialIcons' | 'Feather';
interface IconProps {
name: string;
size?: number;
color?: string;
library?: IconLibrary;
className?: string;
style?: StyleProp<ViewStyle>;
}
export const Icon: React.FC<IconProps> = ({
name,
size = 24,
color,
library = 'FontAwesome',
...props
}) => {
const iconProps = {
size,
color,
...props,
};
switch (library) {
case 'Ionicons':
return <Ionicons name={name as any} {...iconProps} />;
case 'MaterialIcons':
return <MaterialIcons name={name as any} {...iconProps} />;
case 'Feather':
return <Feather name={name as any} {...iconProps} />;
case 'FontAwesome':
default:
return <FontAwesome name={name as any} {...iconProps} />;
}
};