From e15c88794c2057c8afb78df6c48f66d8c3e5c7eb Mon Sep 17 00:00:00 2001 From: maikb Date: Fri, 12 Jan 2024 22:58:52 +0100 Subject: [PATCH] refactor(frontend): Remove useProfile hook from dashboard The useProfile hook from the dashboard section has been removed as no longer needed. This hook was originally intended for fetching profile data, but has been determined to be superfluous. Refs: #1 --- src/sections/dashboard/hooks/use-profile.tsx | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 src/sections/dashboard/hooks/use-profile.tsx diff --git a/src/sections/dashboard/hooks/use-profile.tsx b/src/sections/dashboard/hooks/use-profile.tsx deleted file mode 100644 index 3f42b67..0000000 --- a/src/sections/dashboard/hooks/use-profile.tsx +++ /dev/null @@ -1,18 +0,0 @@ -'use client'; - -import useSWR, { Fetcher } from 'swr'; -import { invoke } from '@tauri-apps/api/tauri'; // see https://stackoverflow.com/a/77264549 - -import { ProfileSet } from '@/modules/profiles/profile'; -export const useProfile = () => { - const fetcher: Fetcher = (cmd: string) => - invoke(cmd); - - const { - data: profileSet, - error, - isLoading, - } = useSWR('get_profiles', fetcher); - - return { profileSet, error, isLoading }; -};