import { useState } from 'react' import { Link } from 'react-router-dom' import { useAuth } from '../contexts/AuthContext' import { useSSHKeys, useAddSSHKey, useDeleteSSHKey } from '../api/queries/sshkeys' export default function SettingsPage() { const { user, logout } = useAuth() const [currentPw, setCurrentPw] = useState('') const [newPw, setNewPw] = useState('') return (

Settings

{/* Account info */}

Account

Edit profile →
{/* Change password */}

Change password

{ e.preventDefault(); setCurrentPw(''); setNewPw('') }} >
setCurrentPw(e.target.value)} className="w-full border border-[#DFE1E6] rounded px-3 py-2 text-sm focus:outline-none focus:border-[#4C9AFF]" />
setNewPw(e.target.value)} className="w-full border border-[#DFE1E6] rounded px-3 py-2 text-sm focus:outline-none focus:border-[#4C9AFF]" />
{/* Danger zone */}

Danger zone

Sign out

End your current session on this device.

) } function Row({ label, value }: { label: string; value?: string }) { return (
{label} {value}
) } function SSHKeySection() { const { data: keys } = useSSHKeys() const addKey = useAddSSHKey() const deleteKey = useDeleteSSHKey() const [showAdd, setShowAdd] = useState(false) const [title, setTitle] = useState('') const [publicKey, setPublicKey] = useState('') const handleAdd = async (e: React.FormEvent) => { e.preventDefault() await addKey.mutateAsync({ title, publicKey }) setTitle(''); setPublicKey(''); setShowAdd(false) } return (

SSH keys

{showAdd && (
setTitle(e.target.value)} required placeholder="e.g. MacBook Pro" className="w-full border border-[#DFE1E6] rounded px-3 py-2 text-sm focus:outline-none focus:border-[#4C9AFF]" />