From 4cbd76b72ec438162d9c3e13cae61c6348dd6011 Mon Sep 17 00:00:00 2001 From: Lorenz Leitner Date: Fri, 18 Mar 2022 16:01:13 +0100 Subject: [PATCH] Use API client in index --- hooks/useApi.ts | 2 +- pages/index.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hooks/useApi.ts b/hooks/useApi.ts index 29e00ce..3c5c888 100644 --- a/hooks/useApi.ts +++ b/hooks/useApi.ts @@ -37,7 +37,7 @@ const useApi = () => { return volDecRequestResult; }; - return { play, pause, volInc, volDec }; + return { play, pause, volInc, volDec } as const; }; export default useApi; diff --git a/pages/index.tsx b/pages/index.tsx index 1ba638f..3783dbb 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -3,13 +3,15 @@ import Head from 'next/head'; import Image from 'next/image'; import { BiMinus, BiPause, BiPlay, BiPlus } from 'react-icons/bi'; import ThemeSwitcher from '../components/ThemeSwitcher'; +import useApi from '../hooks/useApi'; import styles from '../styles/Home.module.scss'; export default function Home() { const { isDark } = useTheme(); + const { play, pause, volInc, volDec } = useApi(); return ( -
+
Home Remote