import React from 'react';
import PropTypes from 'prop-types';
import { DatalistCol } from './DatalistCol';

const propTypes = {
  /**
   * You can use simple value like 'left' or 'top'.
   * You can also use combined values like 'top left' or 'left top'.
   * You can also use responsive values like 'top left middle@md center@md'.
   */
  align: PropTypes.oneOfType([
    PropTypes.oneOf(['left', 'center', 'right', 'top', 'middle', 'bottom']),
    PropTypes.string,
  ]),
  children: PropTypes.node,
  className: PropTypes.string,
  defaultClassName: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
  /**
   * You can use simple value like '1' or '2'.
   * You can also use responsive values like '1 2@md 3@lg'.
   */
  grow: PropTypes.oneOfType([
    PropTypes.oneOf(['1', '2', '3', '4', '5', '6', '7', '8']),
    PropTypes.string,
    PropTypes.number,
  ]),
  /**
   * You can use simple value like 'primary' or 'secondary'.
   */
  level: PropTypes.oneOf(['none', 'primary', 'secondary']),
  /**
   * You can use simple value like 'sm' or 'lg'.
   * You can also use responsive values like 'xs sm@md md@lg'
   */
  size: PropTypes.oneOfType([
    PropTypes.oneOf(['xxs', 'xs', 'sm', 'md', 'lg', 'xl', 'xxl']),
    PropTypes.string,
  ]),
  /**
   * The component used for the root node.
   * Either a string to use a DOM element or a component.
   */
  tag: PropTypes.elementType,
};

const defaultProps = {
  align: '',
  children: '',
  className: '',
  defaultClassName: 'sui-o-datalist__col as--actions',
  grow: '',
  level: 'secondary',
  size: '',
  tag: 'div',
};

export const DatalistColActions = ({ children, ...props }) => (
  <DatalistCol {...props}>
    { children }
  </DatalistCol>
);

DatalistColActions.propTypes = propTypes;
DatalistColActions.defaultProps = defaultProps;
