|
17 | 17 | ); |
18 | 18 | } |
19 | 19 |
|
| 20 | + function AppCard({ name, description, icon, version, link }) { |
| 21 | + return ( |
| 22 | + <Card className="flex flex-col h-full hover:shadow-md transition-all-custom cursor-pointer group"> |
| 23 | + <div className="flex justify-between items-start mb-4"> |
| 24 | + <div className="w-12 h-12 rounded-xl bg-gray-50 border border-gray-100 flex items-center justify-center text-2xl shadow-sm group-hover:scale-105 transition-transform duration-300"> |
| 25 | + {icon} |
| 26 | + </div> |
| 27 | + {version && <span className="px-2 py-1 bg-gray-100 text-gray-500 text-[10px] font-bold uppercase tracking-wider rounded-md">{version}</span>} |
| 28 | + </div> |
| 29 | + <h3 className="text-lg font-bold text-gray-900 mb-1">{name}</h3> |
| 30 | + <p className="text-sm text-gray-500 line-clamp-2 mb-4 flex-1">{description}</p> |
| 31 | + <div className="pt-4 border-t border-gray-100 flex items-center text-blue-600 text-sm font-medium group-hover:translate-x-1 transition-transform"> |
| 32 | + Launch App <span className="ml-1">→</span> |
| 33 | + </div> |
| 34 | + </Card> |
| 35 | + ); |
| 36 | + } |
| 37 | + |
20 | 38 | function DashboardApp() { |
21 | 39 | const [user, setUser] = useState(null); |
22 | 40 | const [loading, setLoading] = useState(true); |
23 | | - const [activeTab, setActiveTab] = useState('overview'); |
24 | | - const [projectName, setProjectName] = useState('Acme Project'); |
| 41 | + const [activeTab, setActiveTab] = useState('apps'); |
25 | 42 |
|
26 | 43 | useEffect(() => { |
27 | 44 | authClient.getSession().then(session => { |
|
53 | 70 | <div className="w-8 h-8 bg-black rounded-lg flex items-center justify-center shadow-md shadow-black/20"> |
54 | 71 | <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="white" strokeWidth="3" strokeLinecap="round" strokeLinejoin="round"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/></svg> |
55 | 72 | </div> |
56 | | - <span className="text-lg font-bold tracking-tight text-gray-900">ObjectQL</span> |
| 73 | + <div> |
| 74 | + <div className="text-[15px] font-bold tracking-tight text-gray-900 leading-none">ObjectQL</div> |
| 75 | + <div className="text-[11px] text-gray-500 font-medium mt-0.5">Admin Server</div> |
| 76 | + </div> |
57 | 77 | </div> |
58 | 78 |
|
59 | 79 | <nav className="space-y-1"> |
60 | 80 | <SidebarItem |
61 | | - icon={Icons.Layout} |
62 | | - label="Overview" |
63 | | - active={activeTab === 'overview'} |
64 | | - onClick={() => setActiveTab('overview')} |
| 81 | + icon={() => <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><rect x="3" y="3" width="7" height="7"></rect><rect x="14" y="3" width="7" height="7"></rect><rect x="14" y="14" width="7" height="7"></rect><rect x="3" y="14" width="7" height="7"></rect></svg>} |
| 82 | + label="Applications" |
| 83 | + active={activeTab === 'apps'} |
| 84 | + onClick={() => setActiveTab('apps')} |
65 | 85 | /> |
66 | 86 | <SidebarItem |
67 | | - icon={Icons.User} |
68 | | - label="Team Members" |
69 | | - active={activeTab === 'team'} |
70 | | - onClick={() => setActiveTab('team')} |
| 87 | + icon={() => <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><ellipse cx="12" cy="5" rx="9" ry="3"></ellipse><path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"></path><path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"></path></svg>} |
| 88 | + label="Data Explorer" |
| 89 | + active={activeTab === 'data'} |
| 90 | + onClick={() => setActiveTab('data')} |
71 | 91 | /> |
72 | 92 | <SidebarItem |
73 | | - icon={Icons.Settings} |
74 | | - label="Settings" |
| 93 | + icon={() => <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.47a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/></svg>} |
| 94 | + label="Server Settings" |
75 | 95 | active={activeTab === 'settings'} |
76 | 96 | onClick={() => setActiveTab('settings')} |
77 | 97 | /> |
|
80 | 100 |
|
81 | 101 | <div className="px-5"> |
82 | 102 | <div className="p-3 bg-white border border-gray-200/60 rounded-xl shadow-sm flex items-center gap-3"> |
83 | | - <div className="w-9 h-9 rounded-full bg-gradient-to-tr from-blue-500 to-purple-500 text-white flex items-center justify-center text-sm font-bold shadow-inner"> |
| 103 | + <div className="w-9 h-9 rounded-full bg-stone-800 text-white flex items-center justify-center text-sm font-bold shadow-inner"> |
84 | 104 | {user.name?.[0]?.toUpperCase() || 'U'} |
85 | 105 | </div> |
86 | 106 | <div className="flex-1 min-w-0"> |
87 | 107 | <p className="text-sm font-semibold text-gray-900 truncate">{user.name}</p> |
88 | | - <p className="text-xs text-gray-500 truncate">{user.email}</p> |
| 108 | + <p className="text-xs text-gray-500 truncate">Administrator</p> |
89 | 109 | </div> |
90 | 110 | <button onClick={() => authClient.signOut()} className="text-gray-400 hover:text-red-500 transition-colors p-1" title="Sign Out"> |
91 | 111 | <Icons.LogOut className="w-4 h-4" /> |
|
96 | 116 |
|
97 | 117 | {/* Main Content */} |
98 | 118 | <main className="flex-1 overflow-auto p-4 sm:p-8"> |
99 | | - <div className="max-w-5xl mx-auto space-y-6 animate-[fadeIn_0.4s_ease-out]"> |
| 119 | + <div className="max-w-6xl mx-auto space-y-6 animate-[fadeIn_0.4s_ease-out]"> |
100 | 120 |
|
101 | | - <header className="flex justify-between items-end mb-8"> |
102 | | - <div> |
103 | | - <h2 className="text-3xl font-bold text-gray-900 tracking-tight">Overview</h2> |
104 | | - <p className="text-gray-500 mt-1">Manage your project and resources.</p> |
105 | | - </div> |
106 | | - <div className="flex gap-3"> |
107 | | - <Button variant="secondary">Documentation</Button> |
108 | | - <Button>New Project</Button> |
109 | | - </div> |
110 | | - </header> |
111 | | - |
112 | | - <div className="grid grid-cols-1 md:grid-cols-3 gap-6"> |
113 | | - {/* Key Metrics */} |
114 | | - <Card className="md:col-span-2 relative overflow-hidden group"> |
115 | | - <div className="absolute top-0 right-0 w-32 h-32 bg-blue-50 rounded-full blur-2xl -mr-10 -mt-10 transition-all group-hover:bg-blue-100/80"></div> |
116 | | - <h3 className="font-semibold text-gray-500 text-xs uppercase tracking-wider mb-1">Project Status</h3> |
117 | | - <div className="text-3xl font-bold text-gray-900 mb-4">{projectName}</div> |
118 | | - <div className="flex gap-2"> |
119 | | - <span className="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800">Active</span> |
120 | | - <span className="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800">Pro Plan</span> |
| 121 | + {activeTab === 'apps' && ( |
| 122 | + <> |
| 123 | + <header className="flex justify-between items-end mb-4"> |
| 124 | + <div> |
| 125 | + <h2 className="text-3xl font-bold text-gray-900 tracking-tight">Applications</h2> |
| 126 | + <p className="text-gray-500 mt-1">Manage installed packages and modules.</p> |
| 127 | + </div> |
| 128 | + <Button variant="secondary" className="gap-2"> |
| 129 | + <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg> |
| 130 | + Install Package |
| 131 | + </Button> |
| 132 | + </header> |
| 133 | + <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6"> |
| 134 | + <AppCard |
| 135 | + name="Project Management" |
| 136 | + description="Comprehensive project tracking, task assignment, and agile workflows." |
| 137 | + icon="🚀" |
| 138 | + version="v1.0.0" |
| 139 | + /> |
| 140 | + <AppCard |
| 141 | + name="User Directory" |
| 142 | + description="Centralized user management, roles, permissions, and organization structure." |
| 143 | + icon="👥" |
| 144 | + version="Core" |
| 145 | + /> |
| 146 | + <AppCard |
| 147 | + name="API Gateway" |
| 148 | + description="Configure routes, middleware, and monitor API traffic and health." |
| 149 | + icon="⚡️" |
| 150 | + version="Core" |
| 151 | + /> |
121 | 152 | </div> |
122 | | - </Card> |
| 153 | + </> |
| 154 | + )} |
123 | 155 |
|
124 | | - <Card className="flex flex-col justify-between"> |
125 | | - <div> |
126 | | - <h3 className="font-semibold text-gray-500 text-xs uppercase tracking-wider mb-2">Team Size</h3> |
127 | | - <div className="text-3xl font-bold text-gray-900">12</div> |
128 | | - </div> |
129 | | - <div className="flex -space-x-2 mt-4"> |
130 | | - {[1,2,3,4].map(i => ( |
131 | | - <div key={i} className="w-8 h-8 rounded-full border-2 border-white bg-gray-200 flex items-center justify-center text-xs font-medium text-gray-600">M{i}</div> |
132 | | - ))} |
| 156 | + {activeTab === 'data' && ( |
| 157 | + <Card title="Data Explorer" description="Browse database objects and schemas directly."> |
| 158 | + <div className="p-12 text-center text-gray-400"> |
| 159 | + <svg className="w-16 h-16 mx-auto mb-4 opacity-20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1" strokeLinecap="round" strokeLinejoin="round"><ellipse cx="12" cy="5" rx="9" ry="3"></ellipse><path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"></path><path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"></path></svg> |
| 160 | + <p>Select an object to inspect data.</p> |
133 | 161 | </div> |
134 | 162 | </Card> |
135 | | - </div> |
| 163 | + )} |
136 | 164 |
|
137 | | - {/* Recent Activity / Content */} |
138 | | - <div className="grid grid-cols-1 gap-6"> |
139 | | - <Card title="Project Settings" description="Update your project configuration."> |
140 | | - <div className="grid gap-6 max-w-lg mt-2"> |
141 | | - <Input |
142 | | - label="Project Name" |
143 | | - value={projectName} |
144 | | - onChange={(e) => setProjectName(e.target.value)} |
145 | | - /> |
146 | | - |
147 | | - <div className="pt-2"> |
148 | | - <Button onClick={() => alert('Saved!')}>Save Changes</Button> |
149 | | - </div> |
150 | | - </div> |
151 | | - </Card> |
152 | | - </div> |
153 | 165 | </div> |
154 | 166 | </main> |
155 | 167 | </div> |
|
0 commit comments