import { Check } from "lucide-react" import { NavLink } from "react-router" import type { RecipientChannel } from "~/lib/api/types" import { cn } from "~/lib/utils" import { useUserStore } from "~/store/user" import { OnlineStatus } from "./online-status" import { Avatar, AvatarImage } from "./ui/avatar" import { Badge } from "./ui/badge" interface PrivateChannelListItemProps { channel: RecipientChannel } export default function PrivateChannelListItem({ channel }: PrivateChannelListItemProps) { const userId = useUserStore(state => state.user?.id) const recipients = channel.recipients.filter(recipient => recipient.id !== userId); const renderSystemBadge = recipients.some(recipient => recipient.system) && recipients.length === 1 return ( <> cn( "rounded-xl justify-start", isActive ? "bg-primary/20" : "bg-accent", ) }>
{recipients.map(recipient => recipient.displayName || recipient.username).join(", ")}
{renderSystemBadge && System}
) }