File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,8 @@ import maestro from '@app/assets/images/card-issuers/maestro.png';
66import { CurrencyTypeEnum , Severity } from '@app/interfaces/interfaces' ;
77import { BaseBadgeProps } from '@app/components/common/BaseBadge/BaseBadge' ;
88import { currencies } from '@app/constants/config/currencies' ;
9-
9+ import { NDKUserProfile } from '@nostr-dev-kit/ndk' ;
10+ import { SubscriberProfile } from '@app/hooks/usePaidSubscribers' ;
1011export const camelize = ( string : string ) : string => {
1112 return string
1213 . split ( ' ' )
@@ -21,7 +22,14 @@ export const getSatsCurrency = (price: number | string, currency: CurrencyTypeEn
2122 // Handle potential negative sign placement
2223 return isIcon ? `${ currencySymbol } ${ formattedPrice } ` : `${ formattedPrice } ${ currency } ` ;
2324} ;
24-
25+ export const convertNDKUserProfileToSubscriberProfile = ( pubkey : string , user : NDKUserProfile ) : SubscriberProfile => {
26+ return {
27+ pubkey,
28+ name : user . name || '' ,
29+ picture : user . picture || '' ,
30+ about : user . about || '' ,
31+ } ;
32+ } ;
2533
2634export const getCurrencyPrice = ( price : number | string , currency : CurrencyTypeEnum , isIcon = true ) : string => {
2735 const currencySymbol = currencies [ currency ] [ isIcon ? 'icon' : 'text' ] ;
You can’t perform that action at this time.
0 commit comments