From adc88dbdf3274d4d0cf15b5f2cf7b0bbb939bfe0 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Sat, 18 Nov 2023 21:21:22 -0800 Subject: v3: re-write frontend using next js --- src/app/page.tsx | 138 +++++++++++-------------------------------------------- 1 file changed, 28 insertions(+), 110 deletions(-) (limited to 'src/app/page.tsx') diff --git a/src/app/page.tsx b/src/app/page.tsx index b973266..81c12b6 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,113 +1,31 @@ -import Image from 'next/image' +import SubscriberTable, {SubscriberDataTableProp} from './_componenets/SubscriberTable/SubscriberTable'; +import TitleBar from './_componenets/TitleBar/TitleBar'; -export default function Home() { - return ( -
-
-

- Get started by editing  - src/app/page.tsx -

-
- - By{' '} - Vercel Logo - -
-
- -
- Next.js Logo -
- -
- -

- Docs{' '} - - -> - -

-

- Find in-depth information about Next.js features and API. -

-
- - -

- Learn{' '} - - -> - -

-

- Learn about Next.js in an interactive course with quizzes! -

-
- - -

- Templates{' '} - - -> - -

-

- Explore starter templates for Next.js. -

-
+async function Home(){ + const apiUrl = process.env.NEXT_PUBLIC_API_URL + const data: SubscriberDataTableProp = await getData(); + return( + <> + +
+ +
+ + + ); +} - -

- Deploy{' '} - - -> - -

-

- Instantly deploy your Next.js site to a shareable URL with Vercel. -

-
-
-
- ) +async function getData(){ + const apiUrl = process.env.NEXT_PUBLIC_API_URL + const response = await fetch(apiUrl+'/api/subscribers', { + headers: { + 'Cache-Control': 'no-cache' + }, + cache: 'no-cache' + }); + if(!response.ok){ + console.log(response.statusText); + } + return response.json(); } +export default Home; \ No newline at end of file -- cgit v1.2.3