Skip to content

Commit

Permalink
fix : remove teams select when no teams
Browse files Browse the repository at this point in the history
  • Loading branch information
psiddharthdesign committed Aug 5, 2024
1 parent d294df7 commit 918cdb5
Showing 1 changed file with 16 additions and 25 deletions.
41 changes: 16 additions & 25 deletions src/components/CreateProjectForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,18 +227,19 @@ export default function CreateProjectForm({ organizationId, repositories, teams
)}
</CardContent>
</MotionCard>
<MotionCard
className="mb-6"
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ delay: 0.2 }}
>
<CardHeader className="flex flex-col space-y-0">
<CardTitle className="text-lg mb-0">Select a Team</CardTitle>
<CardDescription className="text-sm text-muted-foreground mt-0">Choose the team for your project</CardDescription>
</CardHeader>
<CardContent>
{teams.length > 0 ? (
{teams.length !== 0 && (
<MotionCard
className="mb-6"
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ delay: 0.2 }}
>
<CardHeader className="flex flex-col space-y-0">
<CardTitle className="text-lg mb-0">Select a Team</CardTitle>
<CardDescription className="text-sm text-muted-foreground mt-0">Choose the team for your project</CardDescription>
</CardHeader>
<CardContent>

<Controller
name="teamId"
control={control}
Expand Down Expand Up @@ -268,19 +269,9 @@ export default function CreateProjectForm({ organizationId, repositories, teams
</div>
)}
/>
) : (
<div className="text-center py-8">
<div className="bg-muted/50 rounded-full p-4 inline-block">
<Users className="mx-auto size-8 text-muted-foreground" />
</div>
<T.H4 className="mb-1 mt-4">No Teams Found</T.H4>
<T.P className="text-muted-foreground mb-4">
It looks like there are no teams available.
</T.P>
</div>
)}
</CardContent>
</MotionCard>
</CardContent>
</MotionCard>
)}

<MotionCard
className="mb-6"
Expand Down

0 comments on commit 918cdb5

Please sign in to comment.