mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-28 21:42:27 +08:00
refactor(OpenAISettingsGroup): simplify component structure and remove styled components
- Removed unused imports and the StyledSelect component, replacing it with a standard Selector for improved clarity. - Streamlined the layout by eliminating unnecessary styles, enhancing maintainability and readability of the code.
This commit is contained in:
parent
9b57351d1e
commit
c7ab71f01f
@ -4,12 +4,11 @@ import { CollapsibleSettingGroup } from '@renderer/pages/settings/SettingGroup'
|
||||
import { RootState, useAppDispatch } from '@renderer/store'
|
||||
import { setOpenAIServiceTier, setOpenAISummaryText } from '@renderer/store/settings'
|
||||
import { OpenAIServiceTier, OpenAISummaryText } from '@renderer/types'
|
||||
import { Select, Tooltip } from 'antd'
|
||||
import { Tooltip } from 'antd'
|
||||
import { CircleHelp } from 'lucide-react'
|
||||
import { FC, useCallback, useEffect, useMemo } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useSelector } from 'react-redux'
|
||||
import styled from 'styled-components'
|
||||
|
||||
interface Props {
|
||||
isOpenAIReasoning: boolean
|
||||
@ -121,13 +120,11 @@ const OpenAISettingsGroup: FC<Props> = ({
|
||||
<CircleHelp size={14} style={{ marginLeft: 4 }} color="var(--color-text-2)" />
|
||||
</Tooltip>
|
||||
</SettingRowTitleSmall>
|
||||
<StyledSelect
|
||||
<Selector
|
||||
value={summaryText}
|
||||
style={{ width: 135 }}
|
||||
onChange={(value) => {
|
||||
setSummaryText(value as OpenAISummaryText)
|
||||
}}
|
||||
size="small"
|
||||
options={summaryTextOptions}
|
||||
/>
|
||||
</SettingRow>
|
||||
@ -139,12 +136,4 @@ const OpenAISettingsGroup: FC<Props> = ({
|
||||
)
|
||||
}
|
||||
|
||||
const StyledSelect = styled(Select)`
|
||||
.ant-select-selector {
|
||||
border-radius: 15px !important;
|
||||
padding: 4px 10px !important;
|
||||
height: 26px !important;
|
||||
}
|
||||
`
|
||||
|
||||
export default OpenAISettingsGroup
|
||||
|
||||
Loading…
Reference in New Issue
Block a user