import React from 'react';
import { Table as TablePrimitive, TableProps as TablePropsPrimitive } from '@modulz/primitives';

export type TableProps = TablePropsPrimitive

type ExtractRefType<TypesThatMayContainReactRef> = TypesThatMayContainReactRef extends {ref?: React.Ref<infer T>} ? T : any;
type PrimitiveRefType = ExtractRefType<TablePropsPrimitive>  

export const Table = React.forwardRef<PrimitiveRefType, TableProps>((props, ref) => {
  return (
    <TablePrimitive {...props} ref={ref}  styleConfig={{"base":{"th":{"normal":{"paddingTop":"8px","boxShadow":"0 2px 0 0 rgba(0, 0, 0, 0.1)","paddingBottom":"8px"}},"td":{"normal":{"boxShadow":"0 1px 0 0 rgba(0, 0, 0, 0.1)","paddingTop":"8px","paddingBottom":"8px"}}},"variants":{}}}/>
  );
});

export {Thead ,Tfoot ,Tbody ,Tr ,Th ,Td} from '@modulz/primitives';
