Skip to content

Commit 30cc1a6

Browse files
committed
feat: add team
1 parent f361440 commit 30cc1a6

1 file changed

Lines changed: 26 additions & 12 deletions

File tree

src/components/DigitalColleagues/Views/TeamsIndexView.tsx

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { motion, AnimatePresence } from "motion/react"
55
import { DashboardHero } from "../../Heros/DashboardHero/DashboardHero"
66
import { TeamCard } from "../../Projects/team-card"
77
import { type TeamSummary } from "../types"
8+
import { TeamForm, type Team } from "../team-form"
89
import {
910
Dialog,
1011
DialogContent,
@@ -15,7 +16,7 @@ import {
1516

1617
interface TeamsIndexViewProps {
1718
teams?: TeamSummary[]
18-
onCreateTeam?: () => void
19+
onCreateTeam?: (team: Team) => void
1920
onTeamOpen?: (team: TeamSummary) => void
2021
}
2122

@@ -28,7 +29,15 @@ export default function TeamsIndexView({
2829

2930
const handleNewTeamClick = () => {
3031
setIsNewTeamDialogOpen(true)
31-
onCreateTeam?.()
32+
}
33+
34+
const handleTeamSave = (team: Team) => {
35+
onCreateTeam?.(team)
36+
setIsNewTeamDialogOpen(false)
37+
}
38+
39+
const handleTeamCancel = () => {
40+
setIsNewTeamDialogOpen(false)
3241
}
3342

3443
const handleTeamOpen = (team: TeamSummary) => {
@@ -81,18 +90,23 @@ export default function TeamsIndexView({
8190
</motion.div>
8291
</AnimatePresence>
8392

84-
{/* Future: New Team Dialog */}
93+
{/* New Team Dialog */}
8594
<Dialog open={isNewTeamDialogOpen} onOpenChange={setIsNewTeamDialogOpen}>
86-
<DialogContent className="max-w-3xl max-h-[90vh] overflow-y-auto">
87-
<DialogHeader>
88-
<DialogTitle>Create New Team</DialogTitle>
89-
<DialogDescription>
90-
Set up a new team to collaborate with colleagues on projects.
91-
</DialogDescription>
92-
</DialogHeader>
93-
<div className="p-6 text-center text-muted-foreground">
94-
<p>Team creation form coming soon...</p>
95+
<DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto p-0">
96+
<div className="sr-only">
97+
<DialogHeader>
98+
<DialogTitle>Create New Team</DialogTitle>
99+
<DialogDescription>
100+
Set up a new team to collaborate with colleagues on projects.
101+
</DialogDescription>
102+
</DialogHeader>
95103
</div>
104+
<TeamForm
105+
title="Create New Team"
106+
submitLabel="Create Team"
107+
onSave={handleTeamSave}
108+
onCancel={handleTeamCancel}
109+
/>
96110
</DialogContent>
97111
</Dialog>
98112
</div>

0 commit comments

Comments
 (0)