Skip to content

Instantly share code, notes, and snippets.

@Graf009
Created June 1, 2017 12:49
Show Gist options
  • Save Graf009/e44655da99a069494259bb9fcc8882d8 to your computer and use it in GitHub Desktop.
Save Graf009/e44655da99a069494259bb9fcc8882d8 to your computer and use it in GitHub Desktop.
const
import React from 'react'
import bem from 'bem'
import {
IconTools,
EditIcon,
DeleteIcon,
} from 'shared/components/molecules/IconTools'
import './cashbox.scss'
const bCashbox = bem('cashbox')
const CASHBOX_ON_SERVICE = 3
const Cashbox = ({ cashbox, shop, legal }) => {
let legalName = <div className={bCashbox('nope')()}>Без юр. лица</div>
if (legal.has('name')) {
legalName = <div>{legal.get('name')}</div>
}
return (
<div className={bCashbox()}>
<div className={bCashbox('header')()}>
<div className={bCashbox('title')()}>{cashbox.get('name')}</div>
{cashbox.get('status') === CASHBOX_ON_SERVICE
? <div className={bCashbox('repair')()}>В ремонте</div>
: null}
<div className={bCashbox('tools')()}>
<IconTools>
<EditIcon primary />
<DeleteIcon />
</IconTools>
</div>
</div>
<div className={bCashbox('body')()}>
{legalName}
<div>{shop.get('name', 'Без магазина')}</div>
<div>{cashbox.get('serviceCompany')}</div>
</div>
</div>
)
}
export default Cashbox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment