// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: MIT-0 import React, { useEffect, useState } from "react"; import { BrowserRouter as Router, Routes, Route } from "react-router-dom"; import { store } from "./store"; import { Provider } from "react-redux"; import logo from "./ico_connect.svg"; import "./App.css"; import { AppLayout, HelpPanel, Icon, Link, TopNavigation } from "@awsui/components-react"; import HomeComponent from "./components/HomeComponent/HomeComponent"; import ResourcesComponent from "./components/ResourcesComponent/ResourcesComponent"; import FinishComponent from "./components/FinishComponent/FinishComponent"; import AuthComponent from "./components/AuthComponent/AuthComponent"; import axios from "axios"; const tools = { title: "Experience Builder for Amazon Connect", content:

Welcome to the Experience Builder for Amazon Connect!

This application will help you create your first customer experience with Amazon Connect. In a few clicks, you will be able to define and deploy an experience, without any prior knowledge of how things work in Amazon Connect.

While the application will create all the necessary contact flows and resources automatically, we encourage you to familiarize yourself with the concepts by clicking on the "Info" link in each section.

, links: [ { href: "https://docs.aws.amazon.com/connect/latest/adminguide/", text: "Amazon Connect Administration Guide" } ], }; const getDefaultToolsContent = () => tools; const getFormattedToolsContent = (tools: any) => ( {tools.title}} footer={ tools.links && ( <>

Learn more{" "}

) } > {tools.content}
); const useTools = () => { const [toolsContent, setToolsContent] = useState(getFormattedToolsContent(getDefaultToolsContent())); const [isToolsOpen, setIsToolsOpen] = useState(false); const setFormattedToolsContent = (tools: any) => { setToolsContent(getFormattedToolsContent(tools)); }; const openTools = (tools: any) => { if (tools) { setFormattedToolsContent(tools); } setIsToolsOpen(true); }; const closeTools = () => setIsToolsOpen(false); const onToolsChange = (evt: any) => { setIsToolsOpen(evt.detail.open); if (!evt.detail.open) { setFormattedToolsContent(getDefaultToolsContent()); } }; return { toolsContent, isToolsOpen, openTools, closeTools, setFormattedToolsContent, onToolsChange, }; }; function App({}) { const [isAuthenticated, setisAuthenticated] = useState(false); const [user, setUser] = useState(""); const [ apiKey, setApiKey ] = useState(""); const { toolsContent, isToolsOpen, openTools, onToolsChange } = useTools(); const [exectutionArn, setExecutionArn] = useState(""); const [phoneNumber, setPhoneNumber] = useState(""); const setExecution = (value: string) => { setExecutionArn(value); } useEffect(() => { const testApi = async () => { let result = await axios.get(process.env.REACT_APP_API_PATH + "/dev/hello"); console.log(result); if (result.status == 200) { console.log("API is up and running"); } }; testApi(); }, []) return (
{isAuthenticated && } {!isAuthenticated && } } > } > } >
} /> ); } export default App;