import React from 'react';
import { useNavigate } from 'react-router-dom';
import NavBar from '@/components/NavBar';
import SyncSettings from '@/components/SyncSettings';
import { User, CreditCard, Bell, Lock, HelpCircle, LogOut, ChevronRight } from 'lucide-react';
import { cn } from '@/lib/utils';
import { useAuth } from '@/contexts/auth';
import { useToast } from '@/hooks/useToast.wrapper';
const SettingsOption = ({
icon: Icon,
label,
description,
onClick,
color = "text-neuro-income",
disabled = false
}: {
icon: React.ElementType;
label: string;
description?: string;
onClick?: () => void;
color?: string;
disabled?: boolean;
}) => {
return
{label}
{description &&
{description}
}
;
};
const Settings = () => {
const navigate = useNavigate();
const {
user,
signOut
} = useAuth();
const {
toast
} = useToast();
const handleLogout = async () => {
await signOut();
navigate('/login');
};
const handleClick = (path: string) => {
navigate(path);
};
return
{/* Header */}
설정
{/* User Profile */}
{user ?
{user.user_metadata?.username || '사용자'}
{user.email}
:
}
{/* Data Sync Settings */}
{/* Settings Options */}
계정
user ? navigate('/profile') : navigate('/login')} />
user ? navigate('/payment-methods') : navigate('/login')} />
user ? navigate('/notifications') : navigate('/login')} />
앱 설정
navigate('/security-privacy')} />
navigate('/help-support')} />
navigate('/login')} />
;
};
export default Settings;