diff --git a/src/pages/Analytics/Analytics.tsx b/src/pages/Analytics/Analytics.tsx
index 7845ac7e..a1425bf9 100644
--- a/src/pages/Analytics/Analytics.tsx
+++ b/src/pages/Analytics/Analytics.tsx
@@ -16,6 +16,8 @@ import HeaderFull from "@ui_kit/Header/HeaderFull";
import SectionWrapper from "@ui_kit/SectionWrapper";
import { General } from "./General";
+import { Answers } from "./Answers";
+import { Funnel } from "./Funnel";
import { Devices } from "./Devices";
import CalendarIcon from "@icons/CalendarIcon";
@@ -172,6 +174,8 @@ export default function Analytics() {
+
+
>
diff --git a/src/pages/Analytics/Answers.tsx b/src/pages/Analytics/Answers.tsx
new file mode 100644
index 00000000..f1fd6d7e
--- /dev/null
+++ b/src/pages/Analytics/Answers.tsx
@@ -0,0 +1,101 @@
+import { useState } from "react";
+import {
+ Box,
+ Paper,
+ Typography,
+ LinearProgress,
+ useTheme,
+} from "@mui/material";
+
+type AnswerProps = {
+ title: string;
+ percent: number;
+};
+
+const ANSWERS_MOCK: Record = {
+ "Добавьте ответ": 67,
+ "Вопрос пропущен": 7,
+ Другое: 27,
+};
+
+const Answer = ({ title, percent }: AnswerProps) => {
+ const theme = useTheme();
+
+ return (
+
+
+ span": { background: "#9A9AAF1A" },
+ "&::before": {
+ content: `"${title}"`,
+ position: "absolute",
+ zIndex: 1,
+ left: "20px",
+ top: "50%",
+ transform: "translateY(-50%)",
+ color: theme.palette.grey3.main,
+ },
+ }}
+ />
+
+ {`${percent}%`}
+
+
+
+ );
+};
+
+export const Answers = () => {
+ const [answers, setAnswers] = useState>(ANSWERS_MOCK);
+ const theme = useTheme();
+
+ return (
+
+
+ Заголовок вопроса. Варианты ответов
+
+ {Object.entries(answers).map(([title, percent]) => (
+
+ ))}
+
+ );
+};
diff --git a/src/pages/Analytics/Devices.tsx b/src/pages/Analytics/Devices.tsx
index e818368c..bd7e3b42 100644
--- a/src/pages/Analytics/Devices.tsx
+++ b/src/pages/Analytics/Devices.tsx
@@ -20,20 +20,9 @@ const COLORS: Record = {
};
const DEVICES_MOCK: DevicesResponse = {
- device: {
- PC: 75,
- Mobile: 25,
- },
- os: {
- Windows: 44,
- AndroidOS: 25,
- "OS X": 19,
- Linux: 13,
- },
- browser: {
- Chrome: 75,
- Firefox: 25,
- },
+ device: { PC: 75, Mobile: 25 },
+ os: { Windows: 44, AndroidOS: 25, "OS X": 19, Linux: 13 },
+ browser: { Chrome: 75, Firefox: 25 },
};
const Device = ({ title, devices }: DeviceProps) => {
@@ -72,6 +61,7 @@ const Device = ({ title, devices }: DeviceProps) => {
>
{data.map(({ id, value, color }) => (
= {
+ "Стартовая страница": 100,
+ "Воронка квиза": 69,
+ Заявки: 56,
+ Результаты: 56,
+};
+
+const FunnelItem = ({ title, percent }: FunnelItemProps) => {
+ const theme = useTheme();
+
+ return (
+
+
+ {title}
+
+
+
+ 1
+
+
+ span": { background: "#D9C0F9" },
+ }}
+ />
+
+ {`${percent}%`}
+
+
+
+
+ );
+};
+
+export const Funnel = () => {
+ const [funnel, setFunnel] = useState>(FUNNEL_MOCK);
+
+ useEffect(() => {
+ // const requestFunnel = async () => {
+ // const [funnelResponse, funnelError] = await getGeneral("14761");
+ // if (funnelError) {
+ // enqueueSnackbar(funnelError);
+ // return;
+ // }
+ // if (!funnelResponse) {
+ // enqueueSnackbar("Воронка пуста.");
+ // return;
+ // }
+ // setFunnel(funnelResponse);
+ // };
+ // requestFunnel();
+ }, []);
+
+ return (
+
+ {Object.entries(funnel).map(([title, percent]) => (
+
+ ))}
+
+ );
+};
diff --git a/src/pages/Analytics/General.tsx b/src/pages/Analytics/General.tsx
index 408c3e57..e78a7a9a 100644
--- a/src/pages/Analytics/General.tsx
+++ b/src/pages/Analytics/General.tsx
@@ -22,26 +22,10 @@ const COLORS: Record = {
};
const GENERAL_MOCK: GeneralResponse = {
- open: {
- 100: 20,
- 50: 10,
- 60: 5,
- },
- result: {
- 100: 90,
- 10: 3,
- 50: 48,
- },
- avtime: {
- 100: 0,
- 2000: 550,
- 60: 0,
- },
- conversation: {
- 100: 50,
- 1000: 50,
- 10000: 50,
- },
+ open: { 100: 20, 50: 10, 60: 5 },
+ result: { 100: 90, 10: 3, 50: 48 },
+ avtime: { 100: 0, 2000: 550, 60: 0 },
+ conversation: { 100: 50, 1000: 50, 10000: 50 },
};
const GeneralItem = ({ title, general, color, numberType }: GeneralProps) => {