-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Refactored and added join team details dialog
- Loading branch information
1 parent
9e43c7d
commit 26ae057
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
'use client'; | ||
|
||
import { Button } from '@/components/ui/button'; | ||
import { | ||
Dialog, | ||
DialogContent, | ||
DialogFooter, | ||
DialogHeader, | ||
DialogTitle, | ||
DialogTrigger, | ||
} from '@/components/ui/dialog'; | ||
import { Input } from '@/components/ui/input'; | ||
import { Label } from '@/components/ui/label'; | ||
import React, { ReactNode } from 'react'; | ||
import { Team } from '@/app/tournament/[id]/before'; | ||
|
||
interface TeamCard { | ||
team: Team; | ||
children: ReactNode; | ||
} | ||
|
||
export function TeamDetailsDialog({ team, children }: TeamCard) { | ||
return ( | ||
<Dialog> | ||
<DialogTrigger>{children}</DialogTrigger> | ||
<DialogContent className="sm:max-w-[425px]"> | ||
<DialogHeader> | ||
<DialogTitle className="text-left">{team.name}</DialogTitle> | ||
</DialogHeader> | ||
<div className="flex flex-col gap-4"> | ||
<Label>Spillere</Label> | ||
{team.players.map((player) => ( | ||
<li key={player}>{player}</li> | ||
))} | ||
</div> | ||
<DialogFooter> | ||
<Button type="submit">Bli med</Button> | ||
</DialogFooter> | ||
</DialogContent> | ||
</Dialog> | ||
); | ||
} |