27 lines
611 B
TypeScript
27 lines
611 B
TypeScript
import { View, TouchableOpacity } from 'react-native'
|
|
|
|
interface CardProps {
|
|
children: React.ReactNode
|
|
onPress?: () => void
|
|
className?: string
|
|
}
|
|
|
|
export function Card({ children, onPress, className = '' }: CardProps) {
|
|
if (onPress) {
|
|
return (
|
|
<TouchableOpacity
|
|
onPress={onPress}
|
|
className={`bg-white rounded-2xl border border-gray-100 p-4 ${className}`}
|
|
activeOpacity={0.7}
|
|
>
|
|
{children}
|
|
</TouchableOpacity>
|
|
)
|
|
}
|
|
return (
|
|
<View className={`bg-white rounded-2xl border border-gray-100 p-4 ${className}`}>
|
|
{children}
|
|
</View>
|
|
)
|
|
}
|