diff --git a/apps/web/Components/Output/index.jsx b/apps/web/Components/Output/index.jsx index c15e8fd..055e5ce 100644 --- a/apps/web/Components/Output/index.jsx +++ b/apps/web/Components/Output/index.jsx @@ -2,11 +2,39 @@ import PaymentsTable from './PaymentsTable'; import Results from './Results'; import Validation from './Validation'; import Background from '@/Components/Layout/Background'; +import { useStore } from '@/stores/hooks'; import { min } from '@/styles/mq'; +import { observer } from 'mobx-react-lite'; import styled from 'styled-components'; -import Tabs from 'ui/elements/layout/Tabs'; +import { Badge, Tabs } from 'ui'; const outputTabs = [PaymentsTable, Results, Validation]; +const items = outputTabs.map(({ Component, id, title }) => { + let Label = () => title; + + if (id === 'validation') { + Label = observer(() => { + const { $calculation, $tables } = useStore(); + const hasErrors = + $calculation.hasErrors || + $tables.fingap.hasErrors || + $tables.insurance.hasErrors || + $tables.payments.hasErrors; + + return ( + + {title} + + ); + }); + } + + return { + children: , + key: id, + label: