// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: MIT-0 import { Box, Container, ExpandableSection, Header, Input, Link, RadioGroup } from "@awsui/components-react"; import { BaseNavigationDetail } from "@awsui/components-react/internal/events"; import React, { FC, useEffect } from "react"; import MenuComponent from "../MenuComponent/MenuComponent"; import "./CustomerJourneyComponent.css"; interface CustomerJourneyComponentProps { hasOperatingHours: boolean; setExperienceJourney: (journey: { inHours: {}, outHours: {} }) => void; setToolsContent: (tools: any) => void; } const toolsContent = { title: "Customer Journey", content: (

Define the journey your customer will experience when interacting with your contact centre.

Within operating hours, you can decide to send customers directly to a queue, or offer a DTMF menu.

With a DTMF menu, you can send your customers to a queue, transfer them to an external number, or play a message before hanging up.

Tip: You can use the same queue name for multiple options of your menu, resulting in customers following these options to be placed in the same queue.

), links: [ { href: "https://docs.aws.amazon.com/connect/latest/adminguide/about-routing.html", text: "About routing in Amazon Connect" } ], }; const CustomerJourneyComponent: FC = (props) => { const [experienceType, setExperienceType] = React.useState(""); const [queueParam, setQueueParam] = React.useState(""); const [journeyInHours, setJourneyInHours] = React.useState({}); const [journeyTypeInHours, setJourneyTypeInHours] = React.useState("") const [journeyOutHoursMessage, setJourneyOutHoursMessage] = React.useState(""); const updateJourneyTypeInHours = (value: string) => { setJourneyTypeInHours(value); setJourneyInHours({ type: value, journey: {} }); } const setJourneyInHoursQueueParam = (value: string) => { setQueueParam(value); setJourneyInHours({ type: journeyTypeInHours, journey: { action: "transfer", param: value } }) }; const updateJourneyInHours = (journey: {}) => { setJourneyInHours({ type: journeyTypeInHours, journey: journey }); } useEffect(() => { let journey = { inHours: journeyInHours, outHours: props.hasOperatingHours ? { type: "disconnect", message: journeyOutHoursMessage } : {} }; props.setExperienceJourney(journey); }, [journeyInHours, journeyOutHoursMessage]); const setToolsContent = (event: CustomEvent) => { event.preventDefault(); props.setToolsContent(toolsContent); }; return ( Customer Journey{" "} { setToolsContent(event); }} > Info } >
updateJourneyTypeInHours(detail.value)} value={journeyTypeInHours} items={[ { value: "menu", label: "With a DTMF menu" }, { value: "queue", label: "Transfer to a queue" }, ]} /> {journeyTypeInHours === "menu" && } {journeyTypeInHours === "queue" && (
Using the following queue: setJourneyInHoursQueueParam(detail.value)} value={queueParam} placeholder="Enter a name for the queue" />
)}
{props.hasOperatingHours && ( Play the following message and hang up: setJourneyOutHoursMessage(detail.value)} value={journeyOutHoursMessage} placeholder="Enter an outside of hours message" /> )}
); }; export default CustomerJourneyComponent;