import { createElement, forwardRef, HTMLAttributes, RefForwardingComponent, useContext } from 'rax';
import View from 'rax-view';
import Context from './context';

export interface FormFooterProps extends HTMLAttributes<HTMLElement> {
}

const FormFooter: RefForwardingComponent<any, FormFooterProps> = (props, ref) => {
  const { children, style, ...others } = props;
  const { styles } = useContext(Context);
  return (
    <View {...others} ref={ref} style={{ ...styles.footer, ...style }}>
      {children}
    </View>
  );
};

export default forwardRef<any, FormFooterProps>(FormFooter);
