import SettingsTab from "./tab"; import SettingsOption from "./option"; import { TextInput } from "@mantine/core"; import { useCallback, useMemo } from "react"; import { useAppDispatch, useAppSelector } from "../../store"; import { selectOpenAIApiKey, setOpenAIApiKeyFromEvent } from "../../store/api-keys"; import { selectSettingsOption } from "../../store/settings-ui"; import { FormattedMessage, useIntl } from "react-intl"; export default function UserOptionsTab(props: any) { const option = useAppSelector(selectSettingsOption); const openaiApiKey = useAppSelector(selectOpenAIApiKey); const intl = useIntl() const dispatch = useAppDispatch(); const onOpenAIApiKeyChange = useCallback((event: React.ChangeEvent) => dispatch(setOpenAIApiKeyFromEvent(event)), [dispatch]); const elem = useMemo(() => (

), [option, openaiApiKey, onOpenAIApiKeyChange]); return elem; }