import React, { ChangeEvent } from 'react'; import { useTranslation } from 'react-i18next'; import { SunIcon, MoonIcon, PhotoIcon, UserCircleIcon, UserIcon, } from '@heroicons/react/24/outline'; import { getApiPath } from '../../../config/paths'; import LanguageDropdown from '../../Shared/LanguageDropdown'; import TimezoneDropdown from '../../Shared/TimezoneDropdown'; import FirstDayOfWeekDropdown from '../../Shared/FirstDayOfWeekDropdown'; import type { ProfileFormData } from '../types'; import type { getRegionDisplayName, getTimezonesByRegion, } from '../../../utils/timezoneUtils'; interface GeneralTabProps { isActive: boolean; formData: ProfileFormData; onChange: (e: ChangeEvent) => void; onAppearanceChange: (appearance: 'light' | 'dark') => void; onLanguageChange: (languageCode: string) => void; onTimezoneChange: (timezone: string) => void; onFirstDayChange: (value: number) => void; avatarPreview: string | null; onAvatarSelect: (file: File) => void; onAvatarRemove: () => void; timezonesByRegion: ReturnType; getRegionDisplayName: typeof getRegionDisplayName; } const GeneralTab: React.FC = ({ isActive, formData, onChange, onAppearanceChange, onLanguageChange, onTimezoneChange, onFirstDayChange, avatarPreview, onAvatarSelect, onAvatarRemove, timezonesByRegion, getRegionDisplayName, }) => { const { t } = useTranslation(); if (!isActive) return null; return (

{t('profile.accountSettings', 'Account & Preferences')}

{avatarPreview || formData.avatar_image ? ( Avatar ) : (
)}
{(formData.avatar_image || avatarPreview) && ( )}

{t( 'profile.avatarDescription', 'Upload a profile photo (max 5MB)' )}

); }; export default GeneralTab;