From 4644dbb40410a7f521c78e2ae0456c901d9d3ed9 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Fri, 21 Jun 2024 16:05:49 +0300 Subject: [PATCH] merge branch feature/clear-cache-button --- apps/web/Components/Admin/Cache/index.tsx | 38 ++++++++++++++++------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/apps/web/Components/Admin/Cache/index.tsx b/apps/web/Components/Admin/Cache/index.tsx index e9ff863..34c8a28 100644 --- a/apps/web/Components/Admin/Cache/index.tsx +++ b/apps/web/Components/Admin/Cache/index.tsx @@ -1,9 +1,10 @@ import Background from '../../Layout/Background'; import { useFilteredQueries } from './lib/hooks'; import { QueryList } from './QueryList'; +import { reset } from '@/api/cache/query'; import { min } from '@/styles/mq'; import styled from 'styled-components'; -import { Collapse, Divider, Input } from 'ui/elements'; +import { Button, Collapse, Divider, Input } from 'ui/elements'; const Wrapper = styled(Background)` padding: 4px 6px; @@ -21,13 +22,21 @@ const Wrapper = styled(Background)` const Flex = styled.div` display: flex; - margin-bottom: 16px; - justify-content: space-between; + flex-direction: column; gap: 10px; `; +const ButtonWrapper = styled.div` + display: flex; + justify-content: flex-end; +`; + export function Cache() { - const { filteredQueries, setFilterString } = useFilteredQueries(); + const { filteredQueries, refetch, setFilterString } = useFilteredQueries(); + + function handleDeleteQuery() { + return reset().then(() => refetch()); + } if (!filteredQueries) { return
Загрузка...
; @@ -42,15 +51,20 @@ export function Cache() { allowClear onChange={(e) => setFilterString(e.target.value)} /> + ({ + children: , + key: queryGroupName, + label: queryGroupName, + }))} + /> + + + - ({ - children: , - key: queryGroupName, - label: queryGroupName, - }))} - /> ); }