import type { ResponsiveValue } from '@shopify/restyle'; import React, { ReactNode } from 'react'; import { useTheme } from '../../theme/ThemeProvider'; import type { Theme } from './../../theme/theme'; import { Box } from '../Box'; import { Text } from '../Text'; import { CardContainer } from '../CardContainer'; import { TouchableComponent } from '../TouchableComponent'; import CaretRight from '../../icons/CaretRight'; import { Badge, BadgeProps, TypeBadge } from '../Badge'; interface CardProps { icon?: ReactNode; iconBadge?: TypeBadge; iconBadgeVariant?: BadgeProps['variant']; iconAlign?: 'center' | 'flex-end' | 'flex-start'; title: string; titleVariant?: ResponsiveValue; titleWeight?: 'regular' | 'bold'; titleColor?: ResponsiveValue; subtitle?: string; subtitleVariant?: ResponsiveValue; subtitleWeight?: 'regular' | 'bold'; subtitleColor?: ResponsiveValue; innerComponent?: ReactNode; footerText?: string; footerTextVariant?: ResponsiveValue; footerTextWeight?: 'regular' | 'bold'; footerTextColor?: ResponsiveValue; rightComponent?: ReactNode; rightIcon?: ReactNode | 'CaretRight'; footerComponent?: ReactNode; withCardContainer?: boolean; } type Props = React.ComponentProps & CardProps; export const CardBasicItem = ({ icon, iconBadge, iconBadgeVariant = 'primary', iconAlign = 'center', title, titleVariant = 'body', titleWeight = 'bold', titleColor, subtitle, subtitleVariant = 'label', subtitleWeight = 'regular', subtitleColor, innerComponent, footerText, footerTextVariant = 'SubHead', footerTextWeight = 'regular', footerTextColor = 'darkBlueGray', rightComponent, rightIcon = undefined, footerComponent, withCardContainer = true, bg, backgroundColor = 'white', onPress, ...props }: Props) => { const { fonts } = useTheme(); const CardBasicItemComponent = ( cardProps: React.ComponentProps ) => { return ( {!!icon && ( {icon} {true && ( {iconBadge && ( )} )} )} {title} {!!subtitle && ( {subtitle} )} {!!innerComponent && {innerComponent}} {!!footerText && ( {footerText} )} {!!rightComponent && ( {rightComponent} )} {!!rightIcon && ( {rightIcon === 'CaretRight' ? : rightIcon} )} {!!footerComponent && ( {footerComponent} )} ); }; if (withCardContainer) { return ( ); } return ; };