2026-01-07 09:31:02 +00:00
|
|
|
import React from 'react';
|
|
|
|
|
import { Card } from '../ui/card';
|
|
|
|
|
import { Button } from '../ui/button';
|
|
|
|
|
import { CheckCircle, MoreHorizontal } from 'lucide-react';
|
|
|
|
|
import { User } from '../../types';
|
|
|
|
|
|
|
|
|
|
interface UserCardProps {
|
2026-01-13 18:47:57 +00:00
|
|
|
user: Partial<User>;
|
|
|
|
|
onFollow?: () => void;
|
|
|
|
|
onView?: () => void;
|
|
|
|
|
isFollowing?: boolean;
|
2026-01-07 09:31:02 +00:00
|
|
|
}
|
|
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
export const UserCard: React.FC<UserCardProps> = ({
|
|
|
|
|
user,
|
|
|
|
|
onFollow,
|
|
|
|
|
onView,
|
|
|
|
|
isFollowing,
|
|
|
|
|
}) => {
|
|
|
|
|
return (
|
aesthetic-improvements: replace secondary cyan hover states with steel (batch 2)
- Card components: CartItem, WishlistView, PostCard, GroupCard, PlaylistsView, UserCard (7 files)
- Settings components: BackupsView, SessionManagement, CloudIntegrationView, OfflineQueueManager (4 files)
- DashboardPage: stat cards and activity items hover states (2 instances)
- FeedView: input and button hover states (2 instances)
- Upload zones: MetadataForm, CreatePlaylistModal, CreateProductView, AddEquipmentView, CreateGroupModal (5 files, 6 instances)
- UserCard: avatar border hover state
- Total: ~18 files, ~20 instances replaced
- Preserved: Focus rings (cyan), active/selected states (cyan)
- Action 11.3.1.2 in progress (second batch complete)
2026-01-16 09:53:34 +00:00
|
|
|
<Card className="flex flex-col items-center text-center p-6 group hover:border-kodo-steel/50 transition-all relative overflow-hidden">
|
2026-01-07 18:39:21 +00:00
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
<div className="relative mb-4 cursor-pointer" onClick={onView}>
|
aesthetic-improvements: replace secondary cyan hover states with steel (batch 2)
- Card components: CartItem, WishlistView, PostCard, GroupCard, PlaylistsView, UserCard (7 files)
- Settings components: BackupsView, SessionManagement, CloudIntegrationView, OfflineQueueManager (4 files)
- DashboardPage: stat cards and activity items hover states (2 instances)
- FeedView: input and button hover states (2 instances)
- Upload zones: MetadataForm, CreatePlaylistModal, CreateProductView, AddEquipmentView, CreateGroupModal (5 files, 6 instances)
- UserCard: avatar border hover state
- Total: ~18 files, ~20 instances replaced
- Preserved: Focus rings (cyan), active/selected states (cyan)
- Action 11.3.1.2 in progress (second batch complete)
2026-01-16 09:53:34 +00:00
|
|
|
<div className="w-20 h-20 rounded-full border-2 border-kodo-steel p-1 bg-kodo-ink group-hover:border-kodo-steel/50 transition-colors">
|
2026-01-13 18:47:57 +00:00
|
|
|
<img
|
|
|
|
|
src={user.avatar}
|
|
|
|
|
alt={user.username}
|
|
|
|
|
className="w-full h-full rounded-full object-cover"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
{user.roles?.includes('VERIFIED') && (
|
|
|
|
|
<div className="absolute bottom-0 right-0 bg-kodo-cyan text-black rounded-full p-0.5 border-2 border-kodo-ink">
|
|
|
|
|
<CheckCircle className="w-3 h-3" />
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
2026-01-07 09:31:02 +00:00
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
<h3
|
|
|
|
|
className="font-bold text-white text-lg mb-1 cursor-pointer hover:underline"
|
|
|
|
|
onClick={onView}
|
|
|
|
|
>
|
|
|
|
|
{user.username}
|
|
|
|
|
</h3>
|
2026-01-16 00:56:44 +00:00
|
|
|
<p className="text-xs text-kodo-content-dim font-mono mb-3">@{user.username}</p>
|
2026-01-07 09:31:02 +00:00
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
{user.bio && (
|
2026-01-16 00:56:44 +00:00
|
|
|
<p className="text-sm text-kodo-content-dim mb-4 line-clamp-2 min-h-[2.5em]">
|
2026-01-13 18:47:57 +00:00
|
|
|
{user.bio}
|
|
|
|
|
</p>
|
|
|
|
|
)}
|
2026-01-07 18:39:21 +00:00
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
<div className="flex justify-center gap-4 w-full mb-4 border-t border-b border-white/5 py-2">
|
|
|
|
|
<div>
|
|
|
|
|
<div className="font-bold text-white">{user.stats?.tracks || 0}</div>
|
2026-01-16 00:56:44 +00:00
|
|
|
<div className="text-[10px] text-kodo-content-dim uppercase">Tracks</div>
|
2026-01-13 18:47:57 +00:00
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<div className="font-bold text-white">
|
|
|
|
|
{user.stats?.followers || 0}
|
|
|
|
|
</div>
|
2026-01-16 00:56:44 +00:00
|
|
|
<div className="text-[10px] text-kodo-content-dim uppercase">Fans</div>
|
2026-01-13 18:47:57 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-01-07 09:31:02 +00:00
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
<div className="flex gap-2 w-full">
|
|
|
|
|
<Button
|
2026-01-16 01:11:21 +00:00
|
|
|
variant={isFollowing ? 'ghost' : 'default'}
|
2026-01-13 18:47:57 +00:00
|
|
|
size="sm"
|
2026-01-16 00:56:44 +00:00
|
|
|
className={`flex-1 ${isFollowing ? 'border border-kodo-steel text-kodo-content-dim' : ''}`}
|
2026-01-13 18:47:57 +00:00
|
|
|
onClick={onFollow}
|
|
|
|
|
>
|
|
|
|
|
{isFollowing ? 'Following' : 'Follow'}
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
variant="ghost"
|
2026-01-16 01:11:21 +00:00
|
|
|
size="icon"
|
2026-01-13 18:47:57 +00:00
|
|
|
className="border border-kodo-steel"
|
2026-01-16 01:11:21 +00:00
|
|
|
>
|
|
|
|
|
<MoreHorizontal className="w-4 h-4" />
|
|
|
|
|
</Button>
|
2026-01-13 18:47:57 +00:00
|
|
|
</div>
|
|
|
|
|
</Card>
|
|
|
|
|
);
|
|
|
|
|
};
|