source: frontend/src/components/search/UserResult.tsx@ dc30259

main
Last change on this file since dc30259 was cb4a1da, checked in by Filip Gavrilovski <filipgavrilovski28@…>, 5 months ago

add working server side search to landing page; change some endpoints

  • Property mode set to 100644
File size: 1.1 KB
Line 
1import { baseURL } from "../../api/axiosInstance";
2import type { BaseNonAdminUser } from "../../utils/types";
3
4interface UserResultProps {
5 user: BaseNonAdminUser;
6 label: "Artist" | "User";
7}
8
9const UserResult = ({ user, label }: UserResultProps) => {
10 return (
11 <div className="flex items-center gap-4 p-3 rounded-lg hover:bg-white/5 cursor-pointer transition-colors group">
12 {user.profilePhoto ? (
13 <img
14 src={`${baseURL}/${user.profilePhoto}`}
15 alt={user.username}
16 className="w-12 h-12 rounded-full object-cover"
17 />
18 ) : (
19 <div className="w-12 h-12 bg-blue-500 rounded-full flex items-center justify-center">
20 <span className="text-white text-lg font-semibold">
21 {user.username.charAt(0).toUpperCase()}
22 </span>
23 </div>
24 )}
25 <div className="flex-1 min-w-0">
26 <p className="text-white font-medium truncate">{user.fullName}</p>
27 <p className="text-sm text-gray-400 truncate">
28 {label} • @{user.username}
29 </p>
30 </div>
31 <div className="text-right text-xs text-gray-500">
32 <p>{user.followers} followers</p>
33 </div>
34 </div>
35 );
36};
37
38export default UserResult;
Note: See TracBrowser for help on using the repository browser.