import * as React from 'react'; import PropTypes from 'prop-types'; import Tabs from '@mui/material/Tabs'; import Tab from '@mui/material/Tab'; import Typography from '@mui/material/Typography'; import Box from '@mui/material/Box'; import Switch from '@mui/material/Switch'; import useMediaQuery from '@mui/material/useMediaQuery'; import { useTheme } from '@mui/material/styles'; import { Phone, MessageSquare, Shield, Bell, UserCheck, ChevronLeft } from 'lucide-react'; function TabPanel(props) { const { children, value, index, ...other } = props; return ( ); } TabPanel.propTypes = { children: PropTypes.node, index: PropTypes.number.isRequired, value: PropTypes.number.isRequired, }; function a11yProps(index, isMobile) { return { id: `${isMobile ? 'horizontal' : 'vertical'}-tab-${index}`, 'aria-controls': `${isMobile ? 'horizontal' : 'vertical'}-tabpanel-${index}`, }; } const SettingItem = ({ title, description, enabled, onToggle }) => ( {title} {description} ); const TabContent = ({ title, settings, states, onToggle }) => ( {title} {settings.map((setting, index) => ( onToggle(setting.key)} /> ))} ); export default function AccountSettingPage() { const theme = useTheme(); const isMobile = useMediaQuery(theme.breakpoints.down('md')); const [value, setValue] = React.useState(0); const [settings, setSettings] = React.useState({ phoneVisibility: true, chatAlertsNotification: true, chatProtection: true, protectProfilePhoto: true, callProtection: true, matchAlerts: true, profileViews: false, messagePermission: true, blockUnverified: false, }); const handleChange = (event, newValue) => { setValue(newValue); }; const toggleSetting = (key) => { setSettings(prev => ({ ...prev, [key]: !prev[key] })); }; const tabs = [ { id: 0, label: 'Phone Number', fullLabel: 'Phone Number Visibility Controls', icon: , settings: [ { key: 'phoneVisibility', title: 'Phone Number Visibility', description: 'You can control phone number visibility through temporary and permanent methods on your phone. For a single call, dial *67 before the number.', }, ], }, { id: 1, label: 'Chat Alerts', fullLabel: 'Chat Alerts', icon: , settings: [ { key: 'chatAlertsNotification', title: 'Chat Alerts Notification', description: 'Matrimony sites send chat alerts with standard, automated content to notify you of new interactions related to your profile.', }, { key: 'chatProtection', title: 'Chat Protection', description: 'To protect yourself while using matrimonial sites, the primary "chat protection content" is restricting the personal and sensitive information you share both on your public profile and in early conversations.', }, ], }, { id: 2, label: 'Profile', fullLabel: 'Profile Protection', icon: , settings: [ { key: 'protectProfilePhoto', title: 'Protect Profile photo to all', description: 'The photograph privacy settings options are available in the \'My Photos\' section of the \'My Profile\' page.', }, { key: 'callProtection', title: 'Call Protection', description: 'To implement call protection, most major matrimony sites offer built-in privacy features that allow you to control who sees your contact details and photos.', }, ], }, { id: 3, label: 'Match Alerts', fullLabel: 'Match Alerts Preferences', icon: , settings: [ { key: 'matchAlerts', title: 'Match Alert Notifications', description: 'Receive notifications when new profiles match your preferences and requirements.', }, { key: 'profileViews', title: 'Profile View Alerts', description: 'Get notified when someone views your profile or shows interest in connecting with you.', }, ], }, { id: 4, label: 'Messages', fullLabel: 'Who Can Message Me?', icon: , settings: [ { key: 'messagePermission', title: 'Message Permissions', description: 'Control who can send you messages. You can restrict messages to only verified profiles or profiles that match your preferences.', }, { key: 'blockUnverified', title: 'Block Unverified Profiles', description: 'Automatically block messages from profiles that haven\'t completed verification process.', }, ], }, ]; return ( {/* Desktop: Vertical Sidebar */} {!isMobile && ( Settings {tabs.map((tab, index) => ( ))} )} {/* Mobile: Horizontal Tabs */} {isMobile && ( Settings {tabs.map((tab, index) => ( ))} )} {/* Tab Content */} {tabs.map((tab, index) => ( ))} ); }