2025-12-17 13:07:35 +00:00
|
|
|
import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs';
|
2026-01-13 18:47:57 +00:00
|
|
|
import {
|
|
|
|
|
UserSettings,
|
|
|
|
|
PlaybackSettings as PlaybackSettingsType,
|
|
|
|
|
} from '../types/settings';
|
2025-12-17 13:07:35 +00:00
|
|
|
import { PreferenceSettings } from './PreferenceSettings';
|
|
|
|
|
import { NotificationSettings } from './NotificationSettings';
|
|
|
|
|
import { PrivacySettings } from './PrivacySettings';
|
2026-02-20 14:10:02 +00:00
|
|
|
import { ProfileVisibilityCard } from './ProfileVisibilityCard';
|
[FE-PAGE-004] fe-page: Complete Settings page implementation
- Added Account Settings section with password change, data export, and account deletion
- Added Playback Settings section with audio quality, volume, crossfade, and autoplay controls
- Updated SettingsTabs to include Account and Playback tabs (5 tabs total)
- Added PlaybackSettings interface to types
- Integrated account management features (password change, data export, account deletion)
- Added audio playback controls (quality selector, volume slider, crossfade slider, autoplay toggle)
2025-12-24 11:48:28 +00:00
|
|
|
import { AccountSettings } from './AccountSettings';
|
|
|
|
|
import { PlaybackSettings } from './PlaybackSettings';
|
|
|
|
|
|
|
|
|
|
// FE-PAGE-004: Complete Settings page implementation
|
2025-12-17 13:07:35 +00:00
|
|
|
|
|
|
|
|
interface SettingsTabsProps {
|
|
|
|
|
settings: UserSettings;
|
|
|
|
|
onChange: (settings: UserSettings) => void;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function SettingsTabs({ settings, onChange }: SettingsTabsProps) {
|
2026-01-13 18:47:57 +00:00
|
|
|
const handlePreferencesChange = (
|
|
|
|
|
preferences: typeof settings.preferences,
|
|
|
|
|
) => {
|
2025-12-17 13:07:35 +00:00
|
|
|
onChange({
|
|
|
|
|
...settings,
|
|
|
|
|
preferences,
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleNotificationsChange = (
|
|
|
|
|
notifications: typeof settings.notifications,
|
|
|
|
|
) => {
|
|
|
|
|
onChange({
|
|
|
|
|
...settings,
|
|
|
|
|
notifications,
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handlePrivacyChange = (privacy: typeof settings.privacy) => {
|
|
|
|
|
onChange({
|
|
|
|
|
...settings,
|
|
|
|
|
privacy,
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
[FE-PAGE-004] fe-page: Complete Settings page implementation
- Added Account Settings section with password change, data export, and account deletion
- Added Playback Settings section with audio quality, volume, crossfade, and autoplay controls
- Updated SettingsTabs to include Account and Playback tabs (5 tabs total)
- Added PlaybackSettings interface to types
- Integrated account management features (password change, data export, account deletion)
- Added audio playback controls (quality selector, volume slider, crossfade slider, autoplay toggle)
2025-12-24 11:48:28 +00:00
|
|
|
const handlePlaybackChange = (playback: PlaybackSettingsType) => {
|
2025-12-17 13:07:35 +00:00
|
|
|
onChange({
|
|
|
|
|
...settings,
|
[FE-PAGE-004] fe-page: Complete Settings page implementation
- Added Account Settings section with password change, data export, and account deletion
- Added Playback Settings section with audio quality, volume, crossfade, and autoplay controls
- Updated SettingsTabs to include Account and Playback tabs (5 tabs total)
- Added PlaybackSettings interface to types
- Integrated account management features (password change, data export, account deletion)
- Added audio playback controls (quality selector, volume slider, crossfade slider, autoplay toggle)
2025-12-24 11:48:28 +00:00
|
|
|
playback,
|
2025-12-17 13:07:35 +00:00
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
[FE-PAGE-004] fe-page: Complete Settings page implementation
- Added Account Settings section with password change, data export, and account deletion
- Added Playback Settings section with audio quality, volume, crossfade, and autoplay controls
- Updated SettingsTabs to include Account and Playback tabs (5 tabs total)
- Added PlaybackSettings interface to types
- Integrated account management features (password change, data export, account deletion)
- Added audio playback controls (quality selector, volume slider, crossfade slider, autoplay toggle)
2025-12-24 11:48:28 +00:00
|
|
|
// FE-PAGE-004: Initialize playback settings with defaults if not present
|
|
|
|
|
const playbackSettings: PlaybackSettingsType = settings.playback || {
|
|
|
|
|
quality: 'high',
|
|
|
|
|
volume: 0.8,
|
|
|
|
|
crossfade: 3,
|
|
|
|
|
autoplay: true,
|
|
|
|
|
};
|
|
|
|
|
|
2025-12-17 13:07:35 +00:00
|
|
|
return (
|
[FE-PAGE-004] fe-page: Complete Settings page implementation
- Added Account Settings section with password change, data export, and account deletion
- Added Playback Settings section with audio quality, volume, crossfade, and autoplay controls
- Updated SettingsTabs to include Account and Playback tabs (5 tabs total)
- Added PlaybackSettings interface to types
- Integrated account management features (password change, data export, account deletion)
- Added audio playback controls (quality selector, volume slider, crossfade slider, autoplay toggle)
2025-12-24 11:48:28 +00:00
|
|
|
<Tabs defaultValue="account" className="w-full">
|
|
|
|
|
<TabsList className="grid w-full grid-cols-5">
|
|
|
|
|
<TabsTrigger value="account">Account</TabsTrigger>
|
2025-12-17 13:07:35 +00:00
|
|
|
<TabsTrigger value="preferences">Préférences</TabsTrigger>
|
|
|
|
|
<TabsTrigger value="notifications">Notifications</TabsTrigger>
|
|
|
|
|
<TabsTrigger value="privacy">Confidentialité</TabsTrigger>
|
[FE-PAGE-004] fe-page: Complete Settings page implementation
- Added Account Settings section with password change, data export, and account deletion
- Added Playback Settings section with audio quality, volume, crossfade, and autoplay controls
- Updated SettingsTabs to include Account and Playback tabs (5 tabs total)
- Added PlaybackSettings interface to types
- Integrated account management features (password change, data export, account deletion)
- Added audio playback controls (quality selector, volume slider, crossfade slider, autoplay toggle)
2025-12-24 11:48:28 +00:00
|
|
|
<TabsTrigger value="playback">Playback</TabsTrigger>
|
2025-12-17 13:07:35 +00:00
|
|
|
</TabsList>
|
|
|
|
|
|
[FE-PAGE-004] fe-page: Complete Settings page implementation
- Added Account Settings section with password change, data export, and account deletion
- Added Playback Settings section with audio quality, volume, crossfade, and autoplay controls
- Updated SettingsTabs to include Account and Playback tabs (5 tabs total)
- Added PlaybackSettings interface to types
- Integrated account management features (password change, data export, account deletion)
- Added audio playback controls (quality selector, volume slider, crossfade slider, autoplay toggle)
2025-12-24 11:48:28 +00:00
|
|
|
{/* FE-PAGE-004: Account Settings Tab */}
|
|
|
|
|
<TabsContent value="account" className="mt-6">
|
|
|
|
|
<AccountSettings />
|
|
|
|
|
</TabsContent>
|
|
|
|
|
|
2025-12-17 13:07:35 +00:00
|
|
|
<TabsContent value="preferences" className="mt-6">
|
|
|
|
|
<PreferenceSettings
|
|
|
|
|
preferences={settings.preferences}
|
|
|
|
|
onChange={handlePreferencesChange}
|
|
|
|
|
/>
|
|
|
|
|
</TabsContent>
|
|
|
|
|
|
|
|
|
|
<TabsContent value="notifications" className="mt-6">
|
|
|
|
|
<NotificationSettings
|
|
|
|
|
notifications={settings.notifications}
|
|
|
|
|
onChange={handleNotificationsChange}
|
|
|
|
|
/>
|
|
|
|
|
</TabsContent>
|
|
|
|
|
|
2026-02-20 14:10:02 +00:00
|
|
|
<TabsContent value="privacy" className="mt-6 space-y-6">
|
|
|
|
|
<ProfileVisibilityCard />
|
2025-12-17 13:07:35 +00:00
|
|
|
<PrivacySettings
|
|
|
|
|
privacy={settings.privacy}
|
|
|
|
|
onChange={handlePrivacyChange}
|
|
|
|
|
/>
|
|
|
|
|
</TabsContent>
|
|
|
|
|
|
[FE-PAGE-004] fe-page: Complete Settings page implementation
- Added Account Settings section with password change, data export, and account deletion
- Added Playback Settings section with audio quality, volume, crossfade, and autoplay controls
- Updated SettingsTabs to include Account and Playback tabs (5 tabs total)
- Added PlaybackSettings interface to types
- Integrated account management features (password change, data export, account deletion)
- Added audio playback controls (quality selector, volume slider, crossfade slider, autoplay toggle)
2025-12-24 11:48:28 +00:00
|
|
|
{/* FE-PAGE-004: Playback Settings Tab */}
|
|
|
|
|
<TabsContent value="playback" className="mt-6">
|
|
|
|
|
<PlaybackSettings
|
|
|
|
|
playback={playbackSettings}
|
|
|
|
|
onChange={handlePlaybackChange}
|
2025-12-17 13:07:35 +00:00
|
|
|
/>
|
|
|
|
|
</TabsContent>
|
|
|
|
|
</Tabs>
|
|
|
|
|
);
|
|
|
|
|
}
|