import {router as _router} from "expo-router"
import {View, Pressable, TouchableOpacity, TextStyle, ViewStyle} from "react-native"
import {Icon, Text} from "@/components/ignite"
import {useAppTheme} from "@/contexts/ThemeContext"
import GlassView from "@/components/ui/GlassView"
interface StatusCardProps {
label: string
text?: string
style?: ViewStyle
textStyle?: TextStyle
iconStart?: React.ReactNode
iconEnd?: React.ReactNode
subtitle?: string
onPress?: () => void
}
export function StatusCard({label, style, iconStart, iconEnd, textStyle, subtitle, onPress}: StatusCardProps) {
// Extract flex from style to apply to TouchableOpacity wrapper
const {flex, ...restStyle} = (style || {}) as ViewStyle & {flex?: number}
const content = (
{iconStart && {iconStart}}
{subtitle && }
{iconEnd && iconEnd}
)
if (onPress) {
return (
{content}
)
}
if (flex !== undefined) {
return {content}
}
return content
}
interface RouteButtonProps {
label: string
subtitle?: string
onPress?: () => void
onLongPress?: () => void
position?: "top" | "bottom" | "middle"
text?: string
style?: ViewStyle
icon?: React.ReactNode
preset?: "default" | "destructive"
disabled?: boolean
}
export function RouteButton({
label,
subtitle,
onPress,
onLongPress,
style,
text,
icon,
preset = "default",
disabled = false,
}: RouteButtonProps) {
const {theme} = useAppTheme()
const isDestructive = preset === "destructive"
let labelColor = theme.colors.secondary_foreground
if (disabled) labelColor = theme.colors.muted_foreground
else if (isDestructive) labelColor = theme.colors.destructive
return (
{
if (!disabled) onPress?.()
}}
onLongPress={onLongPress}
disabled={disabled || !onPress}
hitSlop={4}
style={({pressed}) => ({opacity: pressed ? 0.2 : 1})}>
{icon && {icon}}
{subtitle && }
{onPress && (
)}
{text && (
)}
)
}