import React , { FC , useMemo } from 'react' ; import { useLabelText } from '@rediagram/cdk' ; import { resolveAsset } from '../../assets' ; import { useAssertProvider } from '../../hooks/assert-provider' ; import { GCPNode } from '../internal/GCPNode' ; import { GCPDependences } from '../../types' ; export type GPUProps = { name : string ; description ? : string ; } & GCPDependences ; function resolveImage ( ) { return resolveAsset ( 'compute/GPU.png' ) ; } function useIcon ( ) { return useMemo ( ( ) => { return { path : resolveImage ( ) , size : 40 , } ; } , [ ] ) ; } export const GPU = ( { name , description , children , ... dependences } ) => { useAssertProvider ( ) ; const icon = useIcon ( ) ; const label = useLabelText ( children , { defaultValue : name , htmlLike : true } ) ; return < GCPNode service = "GPU" name = { name } description = { description } icon = { icon } label = { label } { ... dependences } />; } ; GPU . displayName = 'GPU' ;