import React, { CSSProperties, FC } from "react"; import { View, Text, StyleProp, TextStyle, ViewStyle } from "react-native"; type stateBox = { text: string; title: string; style?: ViewStyle; mode?: number; endText?: string; }; export const StateBox: FC = (props) => { const { text, title, style, mode, endText } = props; return ( {title} {text?.match("~") ? ( <> {text.split("~")[0]} {mode == 2 ? "→" : "↓"} {text.split("~")[1]} ) : ( {text} )} {endText && ( {endText} )} ); }; const boxStyle: ViewStyle = { flex: 1, backgroundColor: "white", borderRadius: 10, padding: 10, margin: 10, }; const boxStyle2: ViewStyle = { flex: 1, backgroundColor: "white", borderRadius: 10, padding: 5, margin: 5, }; const boxTextStyle2: TextStyle = { fontSize: 18, color: "#0099CC", textAlign: "right", }; const boxTextStyle: TextStyle = { fontSize: 25, color: "#0099CC", textAlign: "right", };