/*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ import { DefaultApiClientProvider as DefaultApiClientProvider_ } from "{{apiHooksPackage}}"; import React from "react"; import { useDefaultApiClient } from "../../hooks/useDefaultApiClient"; /** * Sets up the runtimeContext and Cognito auth. * * This assumes a runtime-config.json file is present at '/'. In order for Auth to be set up automatically, * the runtime-config.json must have the following properties configured: [region, userPoolId, userPoolWebClientId, identityPoolId]. */ const DefaultApiClientProvider: React.FC = ({ children }) => { const client = useDefaultApiClient(); return client ? ( {children} ) : ( <> ); }; export default DefaultApiClientProvider;