1import React, { ComponentType, forwardRef } from 'react';
2
3import View from '../primitives/RNWView';
4import { ViewProps } from '../primitives/View';
5
6function createView(nativeProps: ViewProps & { __element: string }): ComponentType<ViewProps> {
7  return forwardRef((props: ViewProps, ref) => {
8    return <View {...nativeProps} {...props} ref={ref} />;
9  }) as ComponentType<ViewProps>;
10}
11
12export const Table = createView({ __element: 'table' });
13Table.displayName = 'Table';
14
15export const THead = createView({ __element: 'thead' });
16THead.displayName = 'THead';
17
18export const TBody = createView({ __element: 'tbody' });
19TBody.displayName = 'TBody';
20
21export const TFoot = createView({ __element: 'tfoot' });
22TFoot.displayName = 'TFoot';
23
24export const TH = createView({ __element: 'th' });
25TH.displayName = 'TH';
26
27export const TR = createView({ __element: 'tr' });
28TR.displayName = 'TR';
29
30export const TD = createView({ __element: 'td' });
31TD.displayName = 'TD';
32
33export const Caption = createView({ __element: 'caption' });
34Caption.displayName = 'Caption';
35