import { useState } from 'react' import { useForm } from 'react-hook-form' import { WorkspaceSettings } from '@/types/settings' export function AdminWorkspaceSettings() { const { register, handleSubmit, formState: { errors } } = useForm({ defaultValues: { name: 'Godspeed', slug: 'godspeed', description: 'Engineering knowledge base', }, }) const [isSaving, setIsSaving] = useState(false) const [message, setMessage] = useState<{ type: 'success' | 'error'; text: string } | null>(null) const onSubmit = async (data: WorkspaceSettings) => { setIsSaving(true) setMessage(null) try { // TODO: PATCH /api/workspace/settings console.log('Update workspace settings:', data) setMessage({ type: 'success', text: 'Workspace settings updated' }) } catch (err) { setMessage({ type: 'error', text: err instanceof Error ? err.message : 'Failed to update settings', }) } finally { setIsSaving(false) } } return (
{/* Workspace Info */}

Workspace Settings

{errors.name &&

{errors.name.message}

}
{errors.slug &&

{errors.slug.message}

}