Chapter 9 - stream single component

This commit is contained in:
2024-01-02 18:17:37 +01:00
parent c52d9d55bc
commit 1824c019ab
2 changed files with 12 additions and 10 deletions

View File

@@ -3,17 +3,17 @@ import { CalendarIcon } from '@heroicons/react/24/outline';
import { lusitana } from '@/app/ui/fonts';
import { Revenue } from '@/app/lib/definitions';
import { fetchRevenue } from '@/app/lib/data';
// This component is representational only.
// For data visualization UI, check out:
// https://www.tremor.so/
// https://www.chartjs.org/
// https://airbnb.io/visx/
export default async function RevenueChart({
revenue,
}: {
revenue: Revenue[];
}) {
export default async function RevenueChart() { // Make component async, remove the props
const revenue = await fetchRevenue(); // Fetch data inside the component
const chartHeight = 350;
// NOTE: comment in this code when you get to this point in the course