import { OriginDeviceDTO } from '@energyweb/origin-device-registry-api-react-query-client' ; import { ComposedPublicDevice } from '../types' ; import { useApiAllDevices } from './allDevices' ; export const useDeviceByExternalRegistryId = ( id ) => { const { allDevices , isLoading } = useApiAllDevices ( ) ; const device = id ? allDevices ?. find ( ( device ) => device . externalRegistryId === id ) : null ; return { device , isLoading } ; } ;