diff --git a/website/src/App.tsx b/website/src/App.tsx index 2c351b8..c5526d0 100644 --- a/website/src/App.tsx +++ b/website/src/App.tsx @@ -7,6 +7,7 @@ import ClockIcon from "./icons/ClockIcon"; import supabase from "./utils/supabase"; import { Histori } from "./types/Histori"; import { Pengaturan } from "./types/Pengaturan"; +import BarsIcon from "./icons/BarsIcon"; export default function (props: JSX.HTMLAttributes) { const menus = [ @@ -34,6 +35,7 @@ export default function (props: JSX.HTMLAttributes) { const [lastHistori, setLastHistori] = createSignal(null); const [canNavigate, setCanNavigate] = createSignal(false); + const [showSidebar, setShowSidebar] = createSignal(false); const location = useLocation(); const navigate = useNavigate(); @@ -100,7 +102,9 @@ export default function (props: JSX.HTMLAttributes) { .limit(1); if (lastHistori()?.selesai != false) { - if (lastData1![0].created_time == lastData2![0].created_time) { + if (lastData1![0] == lastData2![0]) { + alert("Device offline!"); + } else if (lastData1![0].created_time == lastData2![0].created_time) { alert("Device offline!"); } } @@ -123,6 +127,10 @@ export default function (props: JSX.HTMLAttributes) { } }; + const toggleSidebar = () => { + setShowSidebar(!showSidebar()); + }; + onMount(async () => { await checkPengaturan(); await getLastHistori(); @@ -132,6 +140,9 @@ export default function (props: JSX.HTMLAttributes) { return (
-