2020-06-06 01:42:11 +03:00
|
|
|
import React from "react";
|
|
|
|
import ChatBot from "react-simple-chatbot";
|
2020-06-06 02:47:03 +03:00
|
|
|
import { ThemeProvider } from "styled-components";
|
|
|
|
import { useTheme } from "@material-ui/core/styles";
|
2020-06-06 01:42:11 +03:00
|
|
|
|
|
|
|
const Wizard = () => {
|
2020-06-06 02:47:03 +03:00
|
|
|
const theme = useTheme();
|
|
|
|
|
|
|
|
const botTheme = {
|
|
|
|
background: "#f5f8fb",
|
|
|
|
fontFamily: "monospace",
|
|
|
|
headerBgColor: theme.palette.primary.main,
|
|
|
|
headerFontColor: "#fff",
|
|
|
|
headerFontSize: "16px",
|
|
|
|
botBubbleColor: theme.palette.primary.main,
|
|
|
|
botFontColor: "#fff",
|
|
|
|
userBubbleColor: "#fff",
|
|
|
|
userFontColor: "#4a4a4a"
|
|
|
|
};
|
|
|
|
|
2020-06-06 01:42:11 +03:00
|
|
|
const steps = [
|
|
|
|
{
|
2020-06-06 02:47:03 +03:00
|
|
|
id: "1",
|
|
|
|
message: "I'm the wizard.",
|
|
|
|
trigger: "2"
|
2020-06-06 01:42:11 +03:00
|
|
|
},
|
|
|
|
{
|
2020-06-06 02:47:03 +03:00
|
|
|
id: "2",
|
|
|
|
message: "I know everything about nothing. What do you want to ask me?",
|
|
|
|
trigger: "3"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "3",
|
|
|
|
message: "Please hurry. I don't have time to waste.",
|
|
|
|
trigger: "4"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "4",
|
|
|
|
user: true,
|
|
|
|
trigger: "5"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "5",
|
|
|
|
message: "Hi {previousValue}, nice to meet you!",
|
2020-06-06 01:42:11 +03:00
|
|
|
end: true
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2020-06-06 02:47:03 +03:00
|
|
|
return (
|
|
|
|
<ThemeProvider theme={botTheme}>
|
|
|
|
<ChatBot
|
|
|
|
steps={steps}
|
|
|
|
botAvatar="public/icons/wizard.png"
|
|
|
|
headerTitle="Zirhan"
|
|
|
|
/>
|
|
|
|
</ThemeProvider>
|
|
|
|
);
|
2020-06-06 01:42:11 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
export default Wizard;
|