import React, { ReactNode } from 'react'; import { View, StyleSheet, ViewStyle, StyleProp } from 'react-native'; import LinearGradient from 'react-native-linear-gradient'; import { useTheme } from '../theme/context'; interface GradientCardProps { children: ReactNode; style?: StyleProp; } export function GradientCard({ children, style }: GradientCardProps) { const theme = useTheme(); const isGradientAvailable = LinearGradient !== undefined && LinearGradient !== null && (typeof LinearGradient === 'function' || typeof LinearGradient === 'object'); const containerStyle = [ styles.container, { borderRadius: theme.borderRadius.l, borderColor: theme.colors.surface, }, style, ]; if (!isGradientAvailable) { return {children}; } return ( {children} ); } const styles = StyleSheet.create({ container: { borderWidth: 1, overflow: 'hidden', }, });