aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/page.tsx
blob: fb7f1a3c8cc43e1269a17c25201f379e105f7c03 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import SubscriberTable, {SubscriberDataTableProp} from '../components/SubscriberTable/SubscriberTable';
import TitleBar from '../components/TitleBar/TitleBar';

async function Home(){
    const graphURL = process.env.NEXT_PUBLIC_GRAPH_URL
    const data: SubscriberDataTableProp = await getData();
    return(
        <>
            <TitleBar title="PhaseTracker" backgroundColor='black' />
            <div className="sm:block hidden mt-4" style={{ overflow: 'hidden', height: '105vh', position: 'relative' }}>
                <iframe src={graphURL} style={{ position: 'absolute', top: 0, left: 0 }} width="100%" height="100%"></iframe>
            </div>
            <SubscriberTable {...data} />
        </>
    );
}

async function getData(){
    const apiUrl = process.env.NEXT_PUBLIC_API_URL_TESTING
    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;
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage