generated from Blazity/next-enterprise
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59b741b
commit 84ebb2b
Showing
7 changed files
with
73 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,21 @@ | ||
import React from "react" | ||
"use client" | ||
import { useRouter } from "next/navigation" | ||
import React, { useState } from "react" | ||
import CountyFilterSelector from "components/CountyFilterSelector" | ||
|
||
const StatePage: React.FC = () => { | ||
const router = useRouter() | ||
const handleChange = (e: string) => { | ||
router.push(`/state/${e}`) | ||
} | ||
return ( | ||
<div> | ||
<h1>State home page</h1> | ||
<div className="bg-canvas-500 align-center flex min-h-[100vh] items-center justify-center p-8"> | ||
<div className="bg-white p-8 shadow-xl"> | ||
<h1 className="mb-4 text-2xl">State Home Page</h1> | ||
<CountyFilterSelector handleSetFilter={handleChange} /> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default StatePage | ||
export default StatePage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"use client" | ||
import React, { useEffect, useState } from "react"; | ||
import { getTimeseriesChartProps } from "./types"; | ||
import { ds } from "utils/data/service"; | ||
|
||
const TimeseriesChart: React.FC<getTimeseriesChartProps> = ({ id }) => { | ||
const [data, setData] = useState<any[]>([]); | ||
|
||
useEffect(() => { | ||
const fetchData = async () => { | ||
await ds.initDb(); | ||
await ds.initData(); | ||
const data = await ds.getTimeseries(id); | ||
setData(data); | ||
}; | ||
|
||
fetchData(); | ||
}, [id]); | ||
|
||
return <div>TimeseriesChart {id}</div>; | ||
} | ||
|
||
export default TimeseriesChart; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import dynamic from 'next/dynamic' | ||
const TimeseriesChart = dynamic(() => import('components/TimeseriesChart/Renderer'), { ssr: false }) | ||
|
||
export default TimeseriesChart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export type getTimeseriesChartProps = { | ||
id: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters