From e0727c0b17877aac094f7ddb1be0423cb799ed90 Mon Sep 17 00:00:00 2001 From: Denys Dinkevych Date: Tue, 19 Nov 2024 14:16:00 +0200 Subject: [PATCH] Delete UserProfile.tsx --- UserProfile.tsx | 123 ------------------------------------------------ 1 file changed, 123 deletions(-) delete mode 100644 UserProfile.tsx diff --git a/UserProfile.tsx b/UserProfile.tsx deleted file mode 100644 index 49ac09e..0000000 --- a/UserProfile.tsx +++ /dev/null @@ -1,123 +0,0 @@ -import React from 'react'; -import { MapPin, Link as LinkIcon, Twitter, Users, Building, Code } from 'lucide-react'; -import type { GitHubUser } from '../types/github'; - -interface UserProfileProps { - user: GitHubUser; - searchKeyword: string; -} - -function highlightText(text: string, keyword: string) { - if (!keyword.trim() || !text) return text; - const regex = new RegExp(`(${keyword})`, 'gi'); - const parts = text.split(regex); - - return parts.map((part, i) => - regex.test(part) ? ( - - {part} - - ) : ( - part - ) - ); -} - -export default function UserProfile({ user, searchKeyword }: UserProfileProps) { - const formatNumber = (num: number) => { - if (num >= 1000000) return `${(num / 1000000).toFixed(1)}M`; - if (num >= 1000) return `${(num / 1000).toFixed(1)}K`; - return num.toString(); - }; - - return ( -
- - {user.login} - - -
-
- - {user.name || user.login} - - @{user.login} -
- - {user.bio && ( -

- {highlightText(user.bio, searchKeyword)} -

- )} - -
- {user.followers > 0 && ( -
- - {formatNumber(user.followers)} followers ยท {formatNumber(user.following)} following -
- )} - - {user.most_used_language && ( -
- - {user.most_used_language} -
- )} - - {user.location && ( -
- - {highlightText(user.location, searchKeyword)} -
- )} - - {user.company && ( -
- - {highlightText(user.company, searchKeyword)} -
- )} - - {user.blog && ( - - )} - - {user.twitter_username && ( - - )} -
-
-
- ); -} \ No newline at end of file