Files
money/packages/react-native-opentui/index.tsx
2025-11-14 13:26:15 -05:00

34 lines
683 B
TypeScript

import * as React from "react";
import type { ViewProps, TextProps } from "react-native";
export function View({ children, style }: ViewProps) {
const bg = style &&
'backgroundColor' in style
? typeof style.backgroundColor == 'string'
? style.backgroundColor
: undefined
: undefined;
return <box backgroundColor={bg}>{children}</box>
}
export function Text({ style, children }: TextProps) {
const fg = style &&
'color' in style
? typeof style.color == 'string'
? style.color
: undefined
: undefined;
return <text fg={fg || "black"}>{children}</text>
}
export const Platform = {
OS: "tui",
};
export default {
View,
Text,
}