@@ -2,12 +2,8 @@ import clsx from 'clsx'
2
2
import type { EnrichedTweet } from '../utils.js'
3
3
import type { TwitterComponents } from './types.js'
4
4
import { AvatarImg } from './avatar-img.js'
5
- import {
6
- Verified ,
7
- VerifiedGovernment ,
8
- VerifiedBusiness ,
9
- } from './icons/index.js'
10
5
import s from './tweet-header.module.css'
6
+ import { TweetAuthorVerifiedBadge } from './tweet-author-verified-badge.js'
11
7
12
8
type Props = {
13
9
tweet : EnrichedTweet
@@ -17,25 +13,6 @@ type Props = {
17
13
export const TweetHeader = ( { tweet, components } : Props ) => {
18
14
const Img = components ?. AvatarImg ?? AvatarImg
19
15
const { user } = tweet
20
- const verified = user . verified || user . is_blue_verified || user . verified_type
21
- let icon = < Verified />
22
- let iconClassName : string | null = s . verifiedBlue
23
-
24
- if ( verified ) {
25
- if ( ! user . is_blue_verified ) {
26
- iconClassName = s . verifiedOld
27
- }
28
- switch ( user . verified_type ) {
29
- case 'Government' :
30
- icon = < VerifiedGovernment />
31
- iconClassName = s . verifiedGovernment
32
- break
33
- case 'Business' :
34
- icon = < VerifiedBusiness />
35
- iconClassName = null
36
- break
37
- }
38
- }
39
16
40
17
return (
41
18
< div className = { s . header } >
@@ -72,9 +49,7 @@ export const TweetHeader = ({ tweet, components }: Props) => {
72
49
< div className = { s . authorLinkText } >
73
50
< span title = { user . name } > { user . name } </ span >
74
51
</ div >
75
- { verified && (
76
- < div className = { clsx ( s . authorVerified , iconClassName ) } > { icon } </ div >
77
- ) }
52
+ < TweetAuthorVerifiedBadge user = { user } className = { s . authorVerified } />
78
53
</ a >
79
54
< div className = { s . authorMeta } >
80
55
< a
0 commit comments