import { createElement, forwardRef, HTMLAttributes, RefForwardingComponent, useContext } from 'rax';
import List from '@rax-ui/list';
import Context from './context';

export interface FormContentProps extends HTMLAttributes<HTMLElement> {
}

const FormContent: RefForwardingComponent<any, FormContentProps> = (props, ref) => {
  const { children, style, ...others } = props;
  const { styles } = useContext(Context);
  return (
    <List {...others} ref={ref} style={{ ...styles.content, ...style }}>
     {children}
    </List>
  );
};

export default forwardRef<any, FormContentProps>(FormContent);
