"use client"; import { useState } from "react"; import { Badge, badgeVariants } from "@app/components/ui/badge"; import { Popover, PopoverContent, PopoverTrigger } from "@app/components/ui/popover"; import { cn } from "@app/lib/cn"; import { useTranslations } from "next-intl"; const MAX_ROLE_BADGES = 3; export default function UserRoleBadges({ roleLabels, isOwner }: { roleLabels: string[]; isOwner?: boolean; }) { const t = useTranslations(); const visible = roleLabels.slice(0, MAX_ROLE_BADGES); const overflow = roleLabels.slice(MAX_ROLE_BADGES); return (