refactor: remove unused imports and CardFooter from AovTrendChart component
This commit is contained in:
parent
861cd6d26f
commit
e74eff77f2
@ -1,15 +1,13 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import { TrendingUp } from "lucide-react"
|
|
||||||
import { CartesianGrid, Line, LineChart, XAxis, YAxis } from "recharts"
|
import { CartesianGrid, Line, LineChart, XAxis, YAxis } from "recharts"
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Card,
|
Card,
|
||||||
CardContent,
|
CardContent,
|
||||||
CardDescription,
|
CardDescription,
|
||||||
CardFooter,
|
|
||||||
CardHeader,
|
CardHeader,
|
||||||
CardTitle,
|
CardTitle
|
||||||
} from "@/components/ui/card"
|
} from "@/components/ui/card"
|
||||||
import {
|
import {
|
||||||
ChartContainer,
|
ChartContainer,
|
||||||
@ -29,13 +27,13 @@ const chartConfig = {
|
|||||||
} satisfies ChartConfig
|
} satisfies ChartConfig
|
||||||
|
|
||||||
export function AovTrendChart({
|
export function AovTrendChart({
|
||||||
data,
|
data,
|
||||||
title = "Tren AOV",
|
title = "Tren AOV",
|
||||||
description = "Rata-rata nilai belanja per pesanan pelanggan setiap bulannya."
|
description = "Rata-rata nilai belanja per pesanan pelanggan setiap bulannya."
|
||||||
}: {
|
}: {
|
||||||
data: any[],
|
data: any[],
|
||||||
title?: string,
|
title?: string,
|
||||||
description?: string
|
description?: string
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<Card>
|
<Card>
|
||||||
@ -62,21 +60,21 @@ export function AovTrendChart({
|
|||||||
tickFormatter={(value) => value.slice(0, 3)}
|
tickFormatter={(value) => value.slice(0, 3)}
|
||||||
/>
|
/>
|
||||||
<YAxis
|
<YAxis
|
||||||
tickLine={false}
|
tickLine={false}
|
||||||
axisLine={false}
|
axisLine={false}
|
||||||
tickMargin={8}
|
tickMargin={8}
|
||||||
tickFormatter={formatShortCurrency}
|
tickFormatter={formatShortCurrency}
|
||||||
width={60}
|
width={60}
|
||||||
/>
|
/>
|
||||||
<ChartTooltip
|
<ChartTooltip
|
||||||
cursor={false}
|
cursor={false}
|
||||||
content={
|
content={
|
||||||
<ChartTooltipContent
|
<ChartTooltipContent
|
||||||
hideLabel
|
hideLabel
|
||||||
formatter={(value, name) => [
|
formatter={(value, name) => [
|
||||||
formatCurrency(Number(value)),
|
formatCurrency(Number(value)),
|
||||||
` - ${chartConfig[name as keyof typeof chartConfig]?.label ?? name}`,
|
` - ${chartConfig[name as keyof typeof chartConfig]?.label ?? name}`,
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
@ -95,14 +93,6 @@ export function AovTrendChart({
|
|||||||
</LineChart>
|
</LineChart>
|
||||||
</ChartContainer>
|
</ChartContainer>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
<CardFooter className="flex-col items-start gap-2 text-sm">
|
|
||||||
<div className="flex gap-2 leading-none font-medium">
|
|
||||||
Menampilkan tren kualitas belanja pelanggan <TrendingUp className="h-4 w-4" />
|
|
||||||
</div>
|
|
||||||
<div className="leading-none text-muted-foreground">
|
|
||||||
Berdasarkan data operasional Januari - Desember
|
|
||||||
</div>
|
|
||||||
</CardFooter>
|
|
||||||
</Card>
|
</Card>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user