diff --git a/src/features/settings/panels/PanelQMCv2Key.tsx b/src/features/settings/panels/PanelQMCv2Key.tsx index e485d4b..8b7e7e7 100644 --- a/src/features/settings/panels/PanelQMCv2Key.tsx +++ b/src/features/settings/panels/PanelQMCv2Key.tsx @@ -7,26 +7,21 @@ import { Heading, Icon, IconButton, - Input, - InputGroup, - InputLeftElement, - InputRightElement, List, - ListItem, Menu, MenuButton, MenuDivider, MenuItem, MenuList, Text, - VStack, } from '@chakra-ui/react'; import { useDispatch, useSelector } from 'react-redux'; -import { qmc2AddKey, qmc2ClearKeys, qmc2DeleteKey, qmc2UpdateKey } from '../settingsSlice'; +import { qmc2AddKey, qmc2ClearKeys } from '../settingsSlice'; import { selectStagingQMCv2Settings } from '../settingsSelector'; -import React, { useState } from 'react'; -import { MdAdd, MdDelete, MdDeleteForever, MdExpandMore, MdFileUpload, MdVpnKey } from 'react-icons/md'; +import { useState } from 'react'; +import { MdAdd, MdDeleteForever, MdExpandMore, MdFileUpload } from 'react-icons/md'; import { ImportFileModal } from './QMCv2/ImportFileModal'; +import { KeyInput } from './QMCv2/KeyInput'; export function PanelQMCv2Key() { const dispatch = useDispatch(); @@ -34,9 +29,6 @@ export function PanelQMCv2Key() { const [showImportModal, setShowImportModal] = useState(false); const addKey = () => dispatch(qmc2AddKey()); - const updateKey = (prop: 'name' | 'key', id: string, e: React.ChangeEvent) => - dispatch(qmc2UpdateKey({ id, field: prop, value: e.target.value })); - const deleteKey = (id: string) => dispatch(qmc2DeleteKey({ id })); const clearAll = () => dispatch(qmc2ClearKeys()); return ( @@ -50,7 +42,7 @@ export function PanelQMCv2Key() { 客户端的情况下,其「离线加密文件」对应的「密钥」储存在独立的数据库文件内。 - +