import { constants } from "@metro/common"; import { semanticColors } from "@ui/color"; import { createStyles } from "@ui/styles"; import { Platform, Text, TextInput } from "react-native"; export interface CodeblockProps { selectable?: boolean; style?: import("react-native").TextStyle; children?: string; } const useStyles = createStyles({ codeBlock: { fontFamily: constants.Fonts.CODE_NORMAL, fontSize: 12, textAlignVertical: "center", backgroundColor: semanticColors.BACKGROUND_SECONDARY, color: semanticColors.TEXT_NORMAL, borderWidth: 1, borderRadius: 12, borderColor: semanticColors.BACKGROUND_TERTIARY, padding: 10, }, }); // iOS doesn't support the selectable property on RN.Text... const InputBasedCodeblock = ({ style, children }: CodeblockProps) => ; const TextBasedCodeblock = ({ selectable, style, children }: CodeblockProps) => {children}; export default function Codeblock({ selectable, style, children }: CodeblockProps) { if (!selectable) return ; return Platform.select({ ios: , default: , }); }