Fixed the cookie issue (i think)
This commit is contained in:
@@ -15,6 +15,7 @@ import {
|
||||
ChartTooltip,
|
||||
ChartTooltipContent,
|
||||
} from '@/components/ui/chart';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
|
||||
const chartConfig = {
|
||||
views: {
|
||||
@@ -29,7 +30,7 @@ export default function Engagement({
|
||||
chartData: {
|
||||
week: string;
|
||||
views: number;
|
||||
}[];
|
||||
}[] | null;
|
||||
}) {
|
||||
return (
|
||||
<Card>
|
||||
@@ -40,60 +41,66 @@ export default function Engagement({
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<ChartContainer
|
||||
config={chartConfig}
|
||||
className="w-full xl:w-[680px] lg:h-[270px] 2xl:w-[880px]"
|
||||
>
|
||||
<AreaChart
|
||||
accessibilityLayer
|
||||
data={chartData}
|
||||
margin={{
|
||||
left: 12,
|
||||
right: 12,
|
||||
}}
|
||||
{chartData ? (
|
||||
<ChartContainer
|
||||
config={chartConfig}
|
||||
className="w-full xl:w-[680px] lg:h-[270px] 2xl:w-[880px]"
|
||||
>
|
||||
<CartesianGrid vertical={false} />
|
||||
<XAxis
|
||||
dataKey="week"
|
||||
tickLine={false}
|
||||
axisLine={false}
|
||||
tickMargin={8}
|
||||
tickFormatter={(value) => value.slice(0, 3)}
|
||||
/>
|
||||
<ChartTooltip
|
||||
cursor={false}
|
||||
content={<ChartTooltipContent indicator="line" />}
|
||||
/>
|
||||
<defs>
|
||||
<linearGradient
|
||||
id="fillViews"
|
||||
x1="0"
|
||||
y1="0"
|
||||
x2="0"
|
||||
y2="1"
|
||||
>
|
||||
<stop
|
||||
offset="5%"
|
||||
stopColor="var(--color-views)"
|
||||
stopOpacity={0.8}
|
||||
/>
|
||||
<stop
|
||||
offset="95%"
|
||||
stopColor="var(--color-views)"
|
||||
stopOpacity={0.1}
|
||||
/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<AreaChart
|
||||
accessibilityLayer
|
||||
data={chartData}
|
||||
margin={{
|
||||
left: 12,
|
||||
right: 12,
|
||||
}}
|
||||
>
|
||||
<CartesianGrid vertical={false} />
|
||||
<XAxis
|
||||
dataKey="week"
|
||||
tickLine={false}
|
||||
axisLine={false}
|
||||
tickMargin={8}
|
||||
tickFormatter={(value) => value.slice(0, 3)}
|
||||
/>
|
||||
<ChartTooltip
|
||||
cursor={false}
|
||||
content={
|
||||
<ChartTooltipContent indicator="line" />
|
||||
}
|
||||
/>
|
||||
<defs>
|
||||
<linearGradient
|
||||
id="fillViews"
|
||||
x1="0"
|
||||
y1="0"
|
||||
x2="0"
|
||||
y2="1"
|
||||
>
|
||||
<stop
|
||||
offset="5%"
|
||||
stopColor="var(--color-views)"
|
||||
stopOpacity={0.8}
|
||||
/>
|
||||
<stop
|
||||
offset="95%"
|
||||
stopColor="var(--color-views)"
|
||||
stopOpacity={0.1}
|
||||
/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
|
||||
<Area
|
||||
dataKey="views"
|
||||
type="natural"
|
||||
fill="url(#fillViews)"
|
||||
fillOpacity={0.4}
|
||||
stroke="var(--color-views)"
|
||||
/>
|
||||
</AreaChart>
|
||||
</ChartContainer>
|
||||
<Area
|
||||
dataKey="views"
|
||||
type="natural"
|
||||
fill="url(#fillViews)"
|
||||
fillOpacity={0.4}
|
||||
stroke="var(--color-views)"
|
||||
/>
|
||||
</AreaChart>
|
||||
</ChartContainer>
|
||||
) : (
|
||||
<Skeleton className="w-full xl:w-[680px] lg:h-[270px] 2xl:w-[880px]" />
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user