import Chip from '@mui/material/Chip'
import classnames from 'classnames'
import React from 'react'
import { Info2, Label1, Label2 } from 'src/components/typography'
import { numberToFiatAmount } from 'src/utils/number'
import classes from './Cashbox.module.css'
import { primaryColor as zodiac, tomato } from '../../../styling/variables.js'
const colors = {
cashOut: {
empty: tomato,
full: zodiac,
},
cashIn: {
empty: zodiac,
full: tomato,
},
}
const Cashbox = ({
percent = 0,
cashOut = false,
width = 80,
height = 118,
className,
emptyPartClassName,
labelClassName,
omitInnerPercentage,
isLow,
}) => {
const ltHalf = percent <= 51
const color =
colors[cashOut ? 'cashOut' : 'cashIn'][!isLow ? 'full' : 'empty']
return (
{!omitInnerPercentage && ltHalf && (
{percent.toFixed(0)}%
)}
{!omitInnerPercentage && !ltHalf && (
{percent.toFixed(0)}%
)}
)
}
// https://support.lamassu.is/hc/en-us/articles/360025595552-Installing-the-Sintra-Forte
// Sintra and Sintra Forte can have up to 500 notes per cashOut box and up to 1000 per cashIn box
const CashIn = ({
capacity = 500,
currency,
notes,
className,
editingMode = false,
threshold,
width,
height,
total,
omitInnerPercentage,
}) => {
const percent = (100 * notes) / capacity
const isLow = percent < threshold
return (
<>
{!editingMode && (
{notes} notes
{total} {currency.code}
)}
>
)
}
const CashOut = ({
capacity = 500,
denomination = 0,
currency,
notes,
className,
editingMode = false,
threshold,
width,
height,
omitInnerPercentage,
}) => {
const percent = (100 * notes) / capacity
const isLow = percent < threshold
return (
<>
{!editingMode && (
{notes}
{numberToFiatAmount(notes * denomination)} {currency.code}
)}
>
)
}
const CashOutLite = ({
capacity = 500,
denomination = 0,
currency,
notes,
threshold,
width,
}) => {
const percent = (100 * notes) / capacity
const isLow = percent < threshold
return (
)
}
export { Cashbox, CashIn, CashOut, CashOutLite }