import React from 'react';
import type { ReactNode } from 'react';
import type { ViewProps } from 'react-native';
import { ToolbarWrapper } from './StyledToolbar';
import ToolbarGroup from './ToolbarGroup';
import ToolbarMessage from './ToolbarMessage';

interface ToolbarProps extends Omit<ViewProps, 'style'> {
  /**
   * Toolbar's content.
   */
  children?: ReactNode;
}

const Toolbar = ({ children, ...rest }: ToolbarProps) => (
  <ToolbarWrapper {...rest}>{children}</ToolbarWrapper>
);

export default Object.assign(Toolbar, {
  Group: ToolbarGroup,
  Message: ToolbarMessage,
});
