import React from 'react'
import classNames from 'classnames'
import { func, node, string, object, array, oneOfType } from 'prop-types'

const Cell = ({ children, className, innerRef, ...props }) => (
  <td ref={innerRef} className={classNames('sw-table-cell', 'p-4', className)} {...props}>
    {children}
  </td>
)

Cell.displayName = 'Cell'

Cell.propTypes = {
  /** Component's children */
  children: oneOfType([string, node]),
  /** Custom className */
  className: oneOfType([string, object, array]),
  /** Pass down ref */
  innerRef: func
}

export default Cell
