var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
    if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
    return cooked;
};
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import styled from 'styled-components';
import { StyledFont14 } from 'ui/common';
import { getBalanceAmount } from 'utils/formatBalance';
var StyledContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n  align-items: left;\n"], ["\n  align-items: left;\n"])));
var Balance = function (_a) {
    var className = _a.className, value = _a.value, _b = _a.decimals, decimals = _b === void 0 ? 0 : _b, _c = _a.symbol, symbol = _c === void 0 ? '' : _c;
    var balanceAmount = getBalanceAmount(value, decimals);
    var displayValue = balanceAmount.toFormat(3);
    var splitValue = displayValue.split('.');
    return (_jsxs(StyledContainer, __assign({ className: className }, { children: [_jsx(StyledFont14, { children: splitValue[0] }), splitValue[1] ? _jsxs(StyledFont14, __assign({ fontColor: "background02" }, { children: [".", splitValue[1]] })) : null, ' ', symbol && _jsxs(StyledFont14, { children: [" ", symbol] })] })));
};
export default Balance;
var templateObject_1;
