Settings
Manage your account settings and practice information
Password must be at least 8 characters long
"use client"; import { useState } from "react"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Card, CardHeader, CardTitle, CardDescription, CardContent } from "@/components/ui/card"; import { User, Mail, Phone, Save, ArrowLeft, Lock, Eye, EyeOff, } from "lucide-react"; import Link from "next/link"; export default function AdminSettingsPage() { const [loading, setLoading] = useState(false); const [formData, setFormData] = useState({ fullName: "Hammond", email: "admin@attuneheart.com", phone: "+1 (555) 123-4567", }); const [passwordData, setPasswordData] = useState({ currentPassword: "", newPassword: "", confirmPassword: "", }); const [showPasswords, setShowPasswords] = useState({ current: false, new: false, confirm: false, }); const handleInputChange = (field: string, value: string) => { setFormData((prev) => ({ ...prev, [field]: value, })); }; const handlePasswordChange = (field: string, value: string) => { setPasswordData((prev) => ({ ...prev, [field]: value, })); }; const togglePasswordVisibility = (field: "current" | "new" | "confirm") => { setShowPasswords((prev) => ({ ...prev, [field]: !prev[field], })); }; const handleSave = async () => { setLoading(true); // Simulate API call await new Promise((resolve) => setTimeout(resolve, 1000)); setLoading(false); // In a real app, you would show a success message here }; const handlePasswordSave = async () => { if (passwordData.newPassword !== passwordData.confirmPassword) { // In a real app, you would show an error message here alert("New passwords do not match"); return; } if (passwordData.newPassword.length < 8) { // In a real app, you would show an error message here alert("Password must be at least 8 characters long"); return; } setLoading(true); // Simulate API call await new Promise((resolve) => setTimeout(resolve, 1000)); setLoading(false); // Reset password fields setPasswordData({ currentPassword: "", newPassword: "", confirmPassword: "", }); // In a real app, you would show a success message here }; return (
Manage your account settings and practice information
Password must be at least 8 characters long