utils#indonesiaLegends TypeScript Examples

The following examples show how to use utils#indonesiaLegends. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.tsx    From covid19-visualized with MIT License 5 votes vote down vote up
Page: NextPage = () => {
    const { data } = useFetch<IDFormat<IDProvince[]>>(API_INDONESIA + 'provinsi')(
        data => {
            data.data = data.data.filter(({ kodeProvi }) => kodeProvi)
            return data
        }
    )

    return (
        <>
            <Head>
                <title>Indonesia Daily Update | COVID-19 Visualized</title>
                {meta}
            </Head>

            <div className="text-center my-12">
                <h1 className="my-2">Indonesia Update</h1>
            </div>

            <div className="divider-line" />

            <Summary />

            <div className="btn-link my-24">
                <Link href="/indonesia/province">
                    <Button className="my-4" block color="primary" text="See Province Cases" />
                </Link>
                <Link href="/indonesia/cases">
                    <Button className="my-4" block color="success" text="See Case details" />
                </Link>
                <Link href="/">
                    <Button className="my-4" block color="secondary" text="< Back to Home" />
                </Link>
            </div>

            <h2 className="text-center mt-32 mb-12">Indonesia Visualization</h2>
            <Visualization
                id="indonesia-visualization"
                data={data?.data}
                visualize={visualize.indonesia}
                legends={indonesiaLegends.map(({ color, value }) => (
                    <div key={color} className="legends-item font is-size-small">
                        <div className="legends-detail">{value === 0 ? `Tidak ada kasus positif` : `${value} atau lebih kasus positif`}</div>
                        <div className="legends-color mx-4" style={{ backgroundColor: color }} />
                    </div>
                ))}
            />

            <Daily />
        </>
    )
}