1- " use client"
1+ ' use client'
22
3- import { useState } from "react"
4- import { motion , AnimatePresence } from "framer-motion"
5- import { Bot } from "lucide-react"
6- import { DigitalColleageusLayout } from "../DigitalColleageusLayout"
7- import { DashboardHero } from "../../Heros/DashboardHero"
8- import { AppCard } from "../../.archive/app-card"
9- import { FileList } from "../../Projects/file-list"
10- import { ProjectCard } from "../../Projects/project-card"
11- import { type BusinessUnit } from "../types"
12- import {
13-
14- mockApps ,
15- mockRecentFiles ,
16- mockTutorials ,
17-
18- } from "../../dc-temp/mock-data"
19- import {
20- mockSidebarItems ,
21- mockNotifications ,
22- } from "../test-data"
23- import { mockProjectSummary } from "../test-data"
24- import type { App , RecentFile , ProjectSummary } from "../types"
3+ import { useState } from 'react'
4+ import { motion , AnimatePresence } from 'framer-motion'
5+ import { Bot } from 'lucide-react'
6+ import { DigitalColleageusLayout } from '../DigitalColleageusLayout'
7+ import { DashboardHero } from '../../Heros/DashboardHero'
8+ import { AppCard } from '../../.archive/app-card'
9+ import { FileList } from '../../Projects/file-list'
10+ import { ProjectCard } from '../../Projects/project-card'
11+ import { mockApps , mockRecentFiles , mockTutorials } from '../../dc-temp/mock-data'
12+ import { mockSidebarItems , mockNotifications } from '../test-data'
13+ import { mockProjectSummary } from '../test-data'
14+ import type {
15+ App ,
16+ ProjectSummary ,
17+ FileType ,
18+ BusinessUnit ,
19+ Project ,
20+ SidebarItem ,
21+ Colleague ,
22+ User ,
23+ } from '../types'
2524// import { ColleaguesManagement } from "../colleagues-management"
26- import ColleaguesView from " ./../Views/ColleaguesView"
27- import KnowledgeView from " ../Views/KnowledgeView"
25+ import ColleaguesView from ' ./../Views/ColleaguesView'
26+ import KnowledgeView from ' ../Views/KnowledgeView'
2827const AnimatedCircles = ( ) => (
2928 < motion . div
3029 animate = { { rotate : 360 } }
31- transition = { { duration : 50 , repeat : Number . POSITIVE_INFINITY , ease : " linear" } }
30+ transition = { { duration : 50 , repeat : Number . POSITIVE_INFINITY , ease : ' linear' } }
3231 className = "relative h-40 w-40"
3332 >
3433 < div className = "absolute inset-0 rounded-full bg-white/10 backdrop-blur-md" />
@@ -42,63 +41,91 @@ const AnimatedCircles = () => (
4241interface HomeProps {
4342 title ?: string
4443 businessUnits : BusinessUnit [ ]
44+ projects : ProjectSummary [ ]
45+ fileCount : number
46+ teamMemberCount : number
47+ onCreateProject : ( ) => void
48+ onOpenProject : ( project : ProjectSummary ) => void
49+ sidebarItems : SidebarItem [ ]
50+ initialColleagues : Colleague [ ]
51+ users : User [ ]
52+ onColleagueAdd : ( colleague : Colleague ) => void
53+ onColleagueEdit : ( colleague : Colleague ) => void
54+ onColleagueDelete : ( colleagueId : string ) => void
4555}
4656
47- export default function Home ( { title = "Digital Colleagues" , businessUnits } : HomeProps ) {
48- const [ activeTab , setActiveTab ] = useState ( "home" )
57+ export default function Home ( {
58+ title = 'Digital Colleagues' ,
59+ businessUnits,
60+ projects,
61+ fileCount,
62+ teamMemberCount,
63+ onCreateProject,
64+ onOpenProject,
65+ sidebarItems,
66+ initialColleagues,
67+ users,
68+ onColleagueAdd,
69+ onColleagueEdit,
70+ onColleagueDelete,
71+ } : HomeProps ) {
72+ const [ activeTab , setActiveTab ] = useState ( 'home' )
4973 const [ currentBusinessUnit , setCurrentBusinessUnit ] = useState < BusinessUnit > ( businessUnits [ 0 ] ) // Default to Design
5074
5175 // Mock handlers
5276 const handleAppOpen = ( app : App ) => {
53- console . log ( " Opening app:" , app . name )
77+ console . log ( ' Opening app:' , app . name )
5478 }
5579
5680 const handleAppFavorite = ( app : App ) => {
57- console . log ( " Favoriting app:" , app . name )
81+ console . log ( ' Favoriting app:' , app . name )
5882 }
5983
60- const handleFileClick = ( file : RecentFile ) => {
61- console . log ( " Opening file:" , file . name )
84+ const handleFileClick = ( file : FileType ) => {
85+ console . log ( ' Opening file:' , file . name )
6286 }
6387
64- const handleFileShare = ( file : RecentFile ) => {
65- console . log ( " Sharing file:" , file . name )
88+ const handleFileShare = ( file : FileType ) => {
89+ console . log ( ' Sharing file:' , file . name )
6690 }
6791
6892 const handleProjectOpen = ( project : ProjectSummary ) => {
69- console . log ( "Opening project:" , project . name )
93+ console . log ( 'Opening project:' , project . name )
94+ onOpenProject ( project )
7095 }
7196
7297 const handleProjectShare = ( project : ProjectSummary ) => {
73- console . log ( " Sharing project:" , project . name )
98+ console . log ( ' Sharing project:' , project . name )
7499 }
75100
76101 const handleBusinessUnitChange = ( unit : BusinessUnit ) => {
77102 setCurrentBusinessUnit ( unit )
78- console . log ( " Business unit changed to:" , unit . name )
103+ console . log ( ' Business unit changed to:' , unit . name )
79104 }
80105
81106 const handleCopilotClick = ( ) => {
82- console . log ( " Copilot clicked - navigating to chat" )
107+ console . log ( ' Copilot clicked - navigating to chat' )
83108 setActiveTab ( 'chat' )
84109 }
85110
86111 const handleNotificationRemove = ( id : string ) => {
87- console . log ( " Notification removed:" , id )
112+ console . log ( ' Notification removed:' , id )
88113 }
89114
90115 const handleRemoveAll = ( ) => {
91- console . log ( " All notifications removed" )
116+ console . log ( ' All notifications removed' )
92117 }
93118
94119 const renderTabContent = ( ) => {
95120 switch ( activeTab ) {
96- case " home" :
121+ case ' home' :
97122 return (
98123 < div className = "px-2 md:px-4 py-4 space-y-8" >
99124 { /* Hero Section */ }
100125 < section className = "text-center py-12" >
101- < h1 className = "text-4xl font-bold mb-4" > Welcome to the { currentBusinessUnit . name } team</ h1 >
126+ < h1 className = "text-4xl font-bold mb-4" >
127+ Welcome to the { currentBusinessUnit . name } team
128+ </ h1 >
102129 < p className = "text-xl text-muted-foreground mb-8" >
103130 This is your collaborative workspace for productivity and knowledge sharing.
104131 </ p >
@@ -108,17 +135,17 @@ export default function Home({ title = "Digital Colleagues", businessUnits }: Ho
108135 < section className = "grid grid-cols-1 md:grid-cols-3 gap-6" >
109136 < div className = "bg-card p-6 rounded-lg border" >
110137 < h3 className = "text-lg font-semibold mb-2" > Projects</ h3 >
111- < p className = "text-3xl font-bold text-primary" > 12 </ p >
138+ < p className = "text-3xl font-bold text-primary" > { projects . length } </ p >
112139 < p className = "text-sm text-muted-foreground" > Active projects</ p >
113140 </ div >
114141 < div className = "bg-card p-6 rounded-lg border" >
115142 < h3 className = "text-lg font-semibold mb-2" > Team Members</ h3 >
116- < p className = "text-3xl font-bold text-primary" > 8 </ p >
143+ < p className = "text-3xl font-bold text-primary" > { teamMemberCount } </ p >
117144 < p className = "text-sm text-muted-foreground" > Collaborators</ p >
118145 </ div >
119146 < div className = "bg-card p-6 rounded-lg border" >
120147 < h3 className = "text-lg font-semibold mb-2" > Files</ h3 >
121- < p className = "text-3xl font-bold text-primary" > 156 </ p >
148+ < p className = "text-3xl font-bold text-primary" > { fileCount } </ p >
122149 < p className = "text-sm text-muted-foreground" > Project files</ p >
123150 </ div >
124151 </ section >
@@ -127,44 +154,53 @@ export default function Home({ title = "Digital Colleagues", businessUnits }: Ho
127154 // description={`Chat with ${title}.`}
128155 gradient = "bg-gradient-to-r from-pink-600 via-red-600 to-orange-600"
129156 primaryAction = { {
130- label : "Go" ,
157+ label : 'Go' ,
131158 onClick : ( ) => setActiveTab ( 'chat' ) ,
132159 } }
133160 />
134161 </ div >
135162 )
136- case "colleagues" :
137- return < ColleaguesView />
138- case "chat" :
163+ case 'colleagues' :
164+ return (
165+ < ColleaguesView
166+ initialColleagues = { initialColleagues }
167+ availableUsers = { users }
168+ onColleagueAdd = { onColleagueAdd }
169+ onColleagueEdit = { onColleagueEdit }
170+ onColleagueDelete = { onColleagueDelete }
171+ />
172+ )
173+ case 'chat' :
139174 return (
140175 < div className = "px-2 md:px-4 py-4 space-y-8" >
141176 < section className = "text-center py-12" >
142177 < h1 className = "text-4xl font-bold mb-4" > Team Chat</ h1 >
143178 < p className = "text-xl text-muted-foreground mb-8" >
144- Connect with your { currentBusinessUnit . name } team members and collaborate in real-time.
179+ Connect with your { currentBusinessUnit . name } team members and collaborate in
180+ real-time.
145181 </ p >
146182 </ section >
147183 < DashboardHero
148184 title = { `Launch Full Chat Interface` }
149185 description = { `Access the complete chat experience with AI assistance.` }
150186 gradient = "bg-gradient-to-r from-blue-600 via-purple-600 to-pink-600"
151187 primaryAction = { {
152- label : " Open Chat" ,
153- onClick : ( ) => console . log ( " Open full chat interface" ) ,
188+ label : ' Open Chat' ,
189+ onClick : ( ) => console . log ( ' Open full chat interface' ) ,
154190 } }
155191 />
156192 </ div >
157193 )
158- case " apps" :
194+ case ' apps' :
159195 return (
160196 < div className = "space-y-8" >
161197 < DashboardHero
162198 title = "Creative Apps Collection"
163199 description = "Discover our full suite of professional design and creative applications."
164200 gradient = "bg-gradient-to-r from-pink-600 via-red-600 to-orange-600"
165201 primaryAction = { {
166- label : " Install Desktop App" ,
167- onClick : ( ) => console . log ( " Install desktop app clicked" ) ,
202+ label : ' Install Desktop App' ,
203+ onClick : ( ) => console . log ( ' Install desktop app clicked' ) ,
168204 } }
169205 />
170206
@@ -189,24 +225,29 @@ export default function Home({ title = "Digital Colleagues", businessUnits }: Ho
189225 < h2 className = "text-2xl font-semibold" > All Apps</ h2 >
190226 < div className = "grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4" >
191227 { mockApps . map ( ( app ) => (
192- < AppCard key = { app . name } app = { app } onOpen = { handleAppOpen } onFavorite = { handleAppFavorite } />
228+ < AppCard
229+ key = { app . name }
230+ app = { app }
231+ onOpen = { handleAppOpen }
232+ onFavorite = { handleAppFavorite }
233+ />
193234 ) ) }
194235 </ div >
195236 </ section >
196237 </ div >
197238 )
198- case " knowledge" :
239+ case ' knowledge' :
199240 return < KnowledgeView />
200- case " files" :
241+ case ' files' :
201242 return (
202243 < div className = "px-2 md:px-4 py-4 space-y-8" >
203244 < DashboardHero
204245 title = "Your Creative Files"
205246 description = "Access, manage, and share all your design files in one place."
206247 gradient = "bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600"
207248 primaryAction = { {
208- label : " Upload Files" ,
209- onClick : ( ) => console . log ( " Upload files clicked" ) ,
249+ label : ' Upload Files' ,
250+ onClick : ( ) => console . log ( ' Upload files clicked' ) ,
210251 } }
211252 />
212253
@@ -219,23 +260,23 @@ export default function Home({ title = "Digital Colleagues", businessUnits }: Ho
219260 </ section >
220261 </ div >
221262 )
222- case " projects" :
263+ case ' projects' :
223264 return (
224265 < div className = "px-2 md:px-4 py-4 space-y-8" >
225266 < DashboardHero
226267 title = "Project Management"
227268 description = "Organize your creative work into projects and collaborate with your team."
228269 gradient = "bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600"
229270 primaryAction = { {
230- label : " New Project" ,
231- onClick : ( ) => console . log ( "New project clicked" ) ,
271+ label : ' New Project' ,
272+ onClick : onCreateProject ,
232273 } }
233274 />
234275
235276 < section className = "space-y-4" >
236277 < h2 className = "text-2xl font-semibold" > Active Projects</ h2 >
237278 < div className = "grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3" >
238- { mockProjectSummary . map ( ( project ) => (
279+ { projects . map ( ( project ) => (
239280 < ProjectCard
240281 key = { project . name }
241282 project = { project }
@@ -247,16 +288,16 @@ export default function Home({ title = "Digital Colleagues", businessUnits }: Ho
247288 </ section >
248289 </ div >
249290 )
250- case " learn" :
291+ case ' learn' :
251292 return (
252293 < div className = "space-y-8" >
253294 < DashboardHero
254295 title = "Learn & Grow"
255296 description = "Expand your creative skills with tutorials, courses, and resources."
256297 gradient = "bg-gradient-to-r from-green-600 via-emerald-600 to-teal-600"
257298 primaryAction = { {
258- label : " Upgrade to Pro" ,
259- onClick : ( ) => console . log ( " Upgrade to pro clicked" ) ,
299+ label : ' Upgrade to Pro' ,
300+ onClick : ( ) => console . log ( ' Upgrade to pro clicked' ) ,
260301 } }
261302 />
262303
0 commit comments