import { useStore } from '@/stores/hooks'; import { observer } from 'mobx-react-lite'; import styled from 'styled-components'; import { LoadingOutlined } from 'ui/elements/icons'; const TextAddon = styled.span` font-size: 14px; `; const formatter = Intl.NumberFormat('ru', { minimumFractionDigits: 2, }).format; export const IRRAddon = observer(() => { const { $calculation, $process } = useStore(); if ($process.has('Tarif')) { return ( {' Подбирается тариф...'} ); } const tarif = $calculation.element('selectTarif').getValue(); if (!tarif) return Тариф не найден; const { min, max } = $calculation.$values.getValue('irrInfo'); return {`${formatter(min)}% - ${formatter(max)}%`}; });