/**
 * ThreadListItemStyle component
 *
 * Generated by coz on 2017-01-01,
 * from a template provided by apeman-asset-templates.
 *
 * @function ThreadListItemStyle
 */
'use strict'

import React from 'react'
import defineDebug from 'debug'
import { isDark } from 'acolor'
import { ThreadColorCodes } from 'ore-fol-codes'
import { ApStyle } from 'apeman-react-basic'
import { prefixedStyle } from 'ore-fol-helpers'

const debug = defineDebug('project:fragment:thread-list-item-style')

const { COLOR_A: DEFAULT_COLOR } = ThreadColorCodes

/** @lends ThreadListItemStyle */
const ThreadListItemStyle = ({
  prefix = '.thread-list-item',
  color = DEFAULT_COLOR
}) => {
  let monoColor = isDark(color) ? 'white' : '#333'
  let transparentColor = 'transparent'
  let inheritColor = 'inherit'
  let data = prefixedStyle(prefix, {
    '': {
      backgroundColor: color,
      color: monoColor
    },
    '.thread-list-item-disclosure': {
      color: monoColor
    }

  })
  return (
    <ApStyle className='thread-list-item-style'
             data-prefix={ prefix }
             data={ data }
    />
  )
}

export default ThreadListItemStyle
