import { ChangeDetectionStrategy , Component } from '@angular/core' ; import { ChannelsV2Service } from '../channels-v2.service' ; import { Session } from '../../../../services/session' ; import { MindsUser } from '../../../../interfaces/entities' ; @ Component ( { selector : 'm-channelAbout__extraInfo' , changeDetection : ChangeDetectionStrategy . OnPush , templateUrl : 'extra-info.component.html' , } ) export class ChannelAboutExtraInfoComponent { param service param session constructor ( public service , public session ) { } param channel getPaymentMethods ( channel ) { const paymentMethods = [ ] ; if ( channel . merchant && channel . merchant . id ) { paymentMethods . push ( 'USD' ) ; } paymentMethods . push ( 'Off-Chain Tokens' ) ; if ( channel . eth_wallet ) { paymentMethods . push ( 'On-Chain Tokens' , 'ETH' ) ; } if ( channel . btc_address ) { paymentMethods . push ( 'BTC' ) ; } return paymentMethods . join ( ', ' ) . replace ( /,(?!.*,)/gim , ' &' ) ; } param dateStr dobToDate ( dateStr ) { const parts = `${ dateStr }` . split ( '-' ) . map ( part => parseInt ( part ) ) ; if ( parts . length !== 3 ) { return null ; } return new Date ( parts [ 0 ] , parts [ 1 ] - 1 , parts [ 2 ] , 0 , 0 , 0 ) ; } /**
     * Determine whether to show the badges field
     */ hasBadges ( channel ) { const c = channel ; return ( c . pro || c . plus || c . is_admin || c . verified || c . founder || ( c . onchain_booster && c . onchain_booster * 1000 > Date . now ( ) ) ) ; } }