Skip to content

Commit

Permalink
✨ Refactored and added join team details dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
lille-morille committed Feb 19, 2024
1 parent 9e43c7d commit 26ae057
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions components/tournament/teamDetailsDialog.tsx
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>
);
}

0 comments on commit 26ae057

Please sign in to comment.