Commit aab2f9f5 by asranov0003

feat: fetch devices section header

parent 184b37ad
import React, { useState } from "react";
import React, { useEffect, useState } from "react";
import "./SectionHeader.css";
import { Link, useNavigate } from "react-router-dom";
import {
......@@ -7,7 +7,10 @@ import {
type RootState,
} from "../../stores/store";
import CDeviceSelect from "../../components/CDeviceSelect";
import { setSelectedDevice } from "../../stores/slices/deviceSlice";
import {
fetchDevices,
setSelectedDevice,
} from "../../stores/slices/deviceSlice";
import { BiArrowBack } from "react-icons/bi";
import { useTranslation } from "react-i18next";
import CButton from "../../components/CButton";
......@@ -37,6 +40,10 @@ const SectionHeader: React.FC<SectionHeaderProps> = ({ to }) => {
setIsOpenInfoModal((prev) => !prev);
};
useEffect(() => {
dispatch(fetchDevices());
}, [dispatch]);
return (
<div className="sectionheader">
<Link
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment