use warning type for Alerts

This commit is contained in:
vchikalkin 2023-03-28 15:33:21 +03:00
parent a4f0bc717a
commit 6163dbf994
3 changed files with 27 additions and 9 deletions

View File

@ -12,12 +12,18 @@ const Grid = styled(Flex)`
`;
const Validation = observer(() => {
const store = useStore();
const { $tables, $process } = useStore();
const errors = store.$tables.fingap.validation.getErrors();
const errors = $tables.fingap.validation.getErrors();
if (errors?.length) {
return <Alert type="error" banner message={errors[0].message} />;
return (
<Alert
type={$process.has('Unlimited') ? 'warning' : 'error'}
banner
message={errors[0].message}
/>
);
}
return null;

View File

@ -17,12 +17,18 @@ const TableWrapper = styled.div`
`;
const Validation = observer(() => {
const store = useStore();
const { $tables, $process } = useStore();
const errors = store.$tables.insurance.validation.getErrors();
const errors = $tables.insurance.validation.getErrors();
if (errors?.length) {
return <Alert type="error" banner message={errors[0].message} />;
return (
<Alert
type={$process.has('Unlimited') ? 'warning' : 'error'}
banner
message={errors[0].message}
/>
);
}
return null;

View File

@ -30,13 +30,19 @@ const TablesGroupGrid = styled(Box)`
`;
const Validation = observer(() => {
const store = useStore();
const { payments } = store.$tables;
const { $tables, $process } = useStore();
const { payments } = $tables;
const errors = payments.validation.getErrors();
if (errors?.length) {
return <Alert type="error" banner message={errors[0].message} />;
return (
<Alert
type={$process.has('Unlimited') ? 'warning' : 'error'}
banner
message={errors[0].message}
/>
);
}
return null;