import { Avatar } from './Avatar'; import { cn } from '../lib/utils'; import { Friend, FriendRequest } from '../stores/friendStore'; interface FriendCardProps { friend: Friend; onRemove?: () => void; onInvite?: () => void; className?: string; } export function FriendCard({ friend, onRemove, onInvite, className }: FriendCardProps) { return (

{friend.username}

{friend.is_online ? '在线' : '离线'}

{onInvite && friend.is_online && ( )} {onRemove && ( )}
); } interface FriendRequestCardProps { request: FriendRequest; onAccept: () => void; onReject?: () => void; className?: string; } export function FriendRequestCard({ request, onAccept, onReject, className, }: FriendRequestCardProps) { return (

{request.username}

想加你为好友

{onReject && ( )}
); }