'use client';
import {
Users,
Edit3,
Trash2,
Crown,
LogOut
} from 'lucide-react';
import { cn, formatDateTime } from '@/lib/utils';
import { Badge } from '@/components/ui/badge';
import { Button } from '@/components/ui/button';
import type { Team } from '@/services';
export interface TeamCardProps {
team: Team;
onManage?: (teamId: string) => void;
onEdit?: (teamId: string) => void;
onDelete?: (teamId: string) => void;
onLeave?: (teamId: string) => void;
className?: string;
}
export function TeamCard({
team,
onManage,
onEdit,
onDelete,
onLeave,
className = ''
}: TeamCardProps) {
return (
onManage?.(team.id)}
>
{/* Multi-breakpoint Responsive Grid */}
{/* Left Section: Team Name and Info */}
{team.name}
{team.is_owner && (
Owner
)}
{team.description && (
{team.description}
)}
{team.owner_name && (
Owner: {team.owner_name}
)}
•
Created {formatDateTime(team.created_at)}
{/* Middle Section: Stats */}
{team.member_count}
{team.member_count === 1 ? 'Member' : 'Members'}
{/* Right Section: Actions */}
{/* Updated Date */}
Updated {formatDateTime(team.updated_at)}
{/* Action Buttons */}
{team.can_manage ? (
<>
{/* Edit Button - Owner/Admin only */}
{/* Delete Button - Owner/Admin only */}
>
) : (
<>
{/* Leave Button - Members only (not owner) */}
>
)}
);
}