|
1 |
| -import { Stack, Box, Button, Text, px, Code } from '@mantine/core'; |
| 1 | +import { Box, Button, Code, Stack, Text, px } from '@mantine/core'; |
| 2 | +import { FC, useCallback, useState } from 'react'; |
2 | 3 | import { IconClock, IconEye, IconEyeOff, IconTrash, IconX } from '@tabler/icons-react';
|
3 |
| -import { useState, useCallback, FC } from 'react'; |
4 |
| -import classes from '../styles/SavedCorrelationItem.module.css'; |
| 4 | +import { correlationStoreReducers, useCorrelationStore } from '../providers/CorrelationProvider'; |
| 5 | + |
5 | 6 | import { Correlation } from '@/@types/parseable/api/correlation';
|
6 |
| -import dayjs from 'dayjs'; |
7 | 7 | import IconButton from '@/components/Button/IconButton';
|
| 8 | +import classes from '../styles/SavedCorrelationItem.module.css'; |
| 9 | +import dayjs from 'dayjs'; |
8 | 10 | import { useCorrelationsQuery } from '@/hooks/useCorrelations';
|
9 |
| -import { correlationStoreReducers, useCorrelationStore } from '../providers/CorrelationProvider'; |
10 | 11 |
|
11 |
| -const { toggleSavedCorrelationsModal, setCorrelationId } = correlationStoreReducers; |
| 12 | +const { toggleSavedCorrelationsModal, setCorrelationId, cleanCorrelationStore } = correlationStoreReducers; |
12 | 13 |
|
13 | 14 | const renderDeleteIcon = () => <IconTrash size={px('1rem')} stroke={1.5} />;
|
14 | 15 | const renderCloseIcon = () => <IconX size={px('1rem')} stroke={1.5} />;
|
@@ -105,6 +106,7 @@ const SavedCorrelationItem = (props: { item: Correlation }) => {
|
105 | 106 | }, []);
|
106 | 107 |
|
107 | 108 | const onCorrelationAppy = useCallback(() => {
|
| 109 | + setCorrelationData(cleanCorrelationStore); |
108 | 110 | setCorrelationData((store) => setCorrelationId(store, id));
|
109 | 111 | closeModal();
|
110 | 112 | }, []);
|
|
0 commit comments