import { ComponentType, forwardRef } from 'react'; import { StyleSheet, createElement } from 'react-native'; import { TableTextProps } from '../primitives/Table'; import { TextProps } from '../primitives/Text'; import { ViewProps } from '../primitives/View'; export const Table = forwardRef((props: ViewProps, ref) => { return createElement('table', { ...props, style: [styles.reset, props.style], ref }); }) as ComponentType; export const THead = forwardRef((props: ViewProps, ref) => { return createElement('thead', { ...props, style: [styles.reset, props.style], ref }); }) as ComponentType; export const TBody = forwardRef((props: ViewProps, ref) => { return createElement('tbody', { ...props, style: [styles.reset, props.style], ref }); }) as ComponentType; export const TFoot = forwardRef((props: ViewProps, ref) => { return createElement('tfoot', { ...props, style: [styles.reset, props.style], ref }); }) as ComponentType; export const TH = forwardRef((props: TableTextProps, ref) => { return createElement('th', { ...props, style: [styles.reset, props.style], ref }); }) as ComponentType; export const TR = forwardRef((props: ViewProps, ref) => { return createElement('tr', { ...props, style: [styles.reset, props.style], ref }); }) as ComponentType; export const TD = forwardRef((props: TableTextProps, ref) => { return createElement('td', { ...props, style: [styles.reset, props.style], ref }); }) as ComponentType; export const Caption = forwardRef((props: TextProps, ref) => { return createElement('caption', { ...props, style: [styles.reset, props.style], ref }); }) as ComponentType; const styles = StyleSheet.create({ reset: { fontFamily: 'System', padding: 0, }, });