import { RefreshButton } from '@/components/RefreshButton' import { Label } from '@/components/ui/label' import { Select, SelectContent, SelectItem, SelectTrigger } from '@/components/ui/select' import { Switch } from '@/components/ui/switch' import { FONT_SIZE, MEDIA_AUTO_LOAD_POLICY, NOTIFICATION_LIST_STYLE, RANDOM_PUBLISH_RELAY_COUNT } from '@/constants' import { changeAppLanguage, SUPPORTED_APP_LANGUAGE_CODES, TLanguage } from '@/i18n' import { LanguageSelectOptionLines } from '@/lib/language-select-option-lines' import SecondaryPageLayout from '@/layouts/SecondaryPageLayout' import { usePrimaryNoteView } from '@/contexts/primary-note-view-context' import { cn, isSupportCheckConnectionType } from '@/lib/utils' import { useContentPolicy } from '@/providers/ContentPolicyProvider' import { useFontSize } from '@/providers/FontSizeProvider' import { useTheme } from '@/providers/ThemeProvider' import { useUserPreferences } from '@/providers/UserPreferencesProvider' import { useUserTrust } from '@/contexts/user-trust-context' import { TMediaAutoLoadPolicy } from '@/types' import { SelectValue } from '@radix-ui/react-select' import { ExternalLink } from 'lucide-react' import { forwardRef, HTMLProps, useCallback, useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' const GeneralSettingsPage = forwardRef(({ index, hideTitlebar = false }: { index?: number; hideTitlebar?: boolean }, ref) => { const { t, i18n } = useTranslation() const { registerPrimaryPanelRefresh } = usePrimaryNoteView() const [contentKey, setContentKey] = useState(0) const bump = useCallback(() => setContentKey((k) => k + 1), []) const [language, setLanguage] = useState(i18n.language as TLanguage) const { themeSetting, setThemeSetting } = useTheme() const { fontSize, setFontSize } = useFontSize() const { autoplay, setAutoplay, defaultShowNsfw, setDefaultShowNsfw, hideContentMentioningMutedUsers, setHideContentMentioningMutedUsers, mediaAutoLoadPolicy, setMediaAutoLoadPolicy } = useContentPolicy() const { hideUntrustedNotes, updateHideUntrustedNotes } = useUserTrust() const { notificationListStyle, updateNotificationListStyle, addRandomRelaysToPublish, updateAddRandomRelaysToPublish, showLiveActivitiesBanner, updateShowLiveActivitiesBanner } = useUserPreferences() const handleLanguageChange = async (value: TLanguage) => { await changeAppLanguage(value) setLanguage(value) } useEffect(() => { if (!hideTitlebar) { registerPrimaryPanelRefresh(null) return } registerPrimaryPanelRefresh(bump) return () => registerPrimaryPanelRefresh(null) }, [hideTitlebar, registerPrimaryPanelRefresh, bump]) return ( } >
{/* DEPRECATED: Double-panel setting removed for technical debt reduction */}
{t('Custom emoji management')}
{t('After changing emojis, you may need to refresh the page')}
) }) GeneralSettingsPage.displayName = 'GeneralSettingsPage' export default GeneralSettingsPage const SettingItem = forwardRef>( ({ children, className, ...props }, ref) => { return (
{children}
) } ) SettingItem.displayName = 'SettingItem'