import { useState, useEffect } from 'react' import { useParams, useNavigate } from 'react-router-dom' import api from '../services/api' import { CustomFieldList } from '../components/CustomFieldList' import { useToast } from '../contexts/ToastContext' import { Skeleton } from '../components/Skeleton' interface Project { id: string title: string description: string | null space_id: string owner_id: string security_level: string } export default function ProjectSettings() { const { projectId } = useParams() const navigate = useNavigate() const { showToast } = useToast() const [project, setProject] = useState(null) const [loading, setLoading] = useState(true) const [activeTab, setActiveTab] = useState<'general' | 'custom-fields'>('custom-fields') useEffect(() => { loadProject() }, [projectId]) const loadProject = async () => { try { const response = await api.get(`/projects/${projectId}`) setProject(response.data) } catch (err) { console.error('Failed to load project:', err) showToast('Failed to load project settings', 'error') } finally { setLoading(false) } } if (loading) { return (
) } if (!project) { return
Project not found
} return (
navigate('/spaces')} style={styles.breadcrumbLink}> Spaces / navigate(`/spaces/${project.space_id}`)} style={styles.breadcrumbLink} > Projects / navigate(`/projects/${project.id}`)} style={styles.breadcrumbLink} > {project.title} / Settings

Project Settings

{/* Sidebar Navigation */}
{/* Content Area */}
{activeTab === 'general' && (

General Settings

Project Name {project.title}
Description {project.description || 'No description'}
Security Level {project.security_level}

To edit project details, contact the project owner.

)} {activeTab === 'custom-fields' && ( )}
) } const styles: Record = { container: { padding: '24px', maxWidth: '1200px', margin: '0 auto', }, breadcrumb: { marginBottom: '16px', fontSize: '14px', color: '#666', }, breadcrumbLink: { color: '#0066cc', cursor: 'pointer', }, breadcrumbSeparator: { margin: '0 8px', }, header: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '24px', }, title: { fontSize: '24px', fontWeight: 600, margin: 0, }, backButton: { padding: '10px 20px', backgroundColor: '#f5f5f5', border: '1px solid #ddd', borderRadius: '6px', cursor: 'pointer', fontSize: '14px', }, layout: { display: 'flex', gap: '24px', }, sidebar: { width: '200px', flexShrink: 0, }, nav: { display: 'flex', flexDirection: 'column', gap: '4px', }, navItem: { padding: '12px 16px', backgroundColor: 'transparent', border: 'none', borderRadius: '6px', cursor: 'pointer', fontSize: '14px', textAlign: 'left', color: '#333', transition: 'background-color 0.2s', }, navItemActive: { backgroundColor: '#e3f2fd', color: '#0066cc', fontWeight: 500, }, content: { flex: 1, minWidth: 0, }, section: { backgroundColor: 'white', borderRadius: '8px', padding: '24px', boxShadow: '0 1px 3px rgba(0, 0, 0, 0.1)', }, sectionTitle: { fontSize: '18px', fontWeight: 600, margin: '0 0 20px 0', }, infoCard: { backgroundColor: '#fafafa', borderRadius: '8px', padding: '16px', marginBottom: '16px', }, infoRow: { display: 'flex', padding: '12px 0', borderBottom: '1px solid #eee', }, infoLabel: { width: '150px', fontSize: '14px', fontWeight: 500, color: '#666', }, infoValue: { flex: 1, fontSize: '14px', color: '#333', }, helpText: { fontSize: '13px', color: '#888', fontStyle: 'italic', }, loading: { display: 'flex', justifyContent: 'center', alignItems: 'center', height: '200px', color: '#666', }, error: { display: 'flex', justifyContent: 'center', alignItems: 'center', height: '200px', color: '#f44336', }, }