import React , { FC , ReactElement , useMemo } from 'react' ; import { IconNode , useLabelText } from '@rediagram/cdk' ; import { resolveAsset } from '../../assets' ; import { useAssertProvider } from '../../hooks/assert-provider' ; import { AWSDependences } from '../../types' ; import { useAWSContext } from '../../hooks/context' ; import { SubLabel } from '../../hooks/service-name' ; export type GameTechProps = { name : string ; } & AWSDependences ; function resolveImage ( ) { return resolveAsset ( 'developer-tools/GameTech.png' ) ; } function useIcon ( ) { return useMemo ( ( ) => { return { path : resolveImage ( ) , size : 56 , } ; } , [ ] ) ; } function useServiceName ( ) { const { serviceName } = useAWSContext ( ) ; if ( serviceName ) { return SubLabel ( 'Game Tech' ) ; } return undefined ; } export const GameTech = ( { name , children , ... dependences } ) => { useAssertProvider ( ) ; const icon = useIcon ( ) ; const label = useLabelText ( children , { defaultValue : name , htmlLike : true } ) ; const subLabel = useServiceName ( ) ; return < IconNode name = { name } icon = { icon } label = { label } subLabel = { subLabel } { ... dependences } />; } ; GameTech . displayName = 'GameTech' ;