"use client"
import { Ellipsis } from "lucide-react"
import { Badge } from "@/components/ui/badge"
import { Bar, BarChart, AreaChart, Area } from "recharts"
import { Button } from "@/components/ui/button"
import { Progress } from "@/components/ui/progress"
import {
ChartContainer,
ChartTooltip,
ChartTooltipContent,
} from "@/components/ui/chart"
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
CardFooter
} from "@/components/ui/card"
const chartData_stats_stat1 = [
{ month: "January", desktop: 186 },
{ month: "February", desktop: 305 },
{ month: "March", desktop: 237 },
{ month: "April", desktop: 73 },
{ month: "May", desktop: 209 },
{ month: "June", desktop: 214 },
{ month: "July", desktop: 186 },
{ month: "August", desktop: 305 },
{ month: "September", desktop: 237 },
{ month: "October", desktop: 73 },
{ month: "November", desktop: 209 },
{ month: "December", desktop: 214 },
]
const chartContainer1_stats_stat1 = {
desktop: {
label: "Desktop",
color: "#2D70F5",
}
};
const chartContainer2_stats_stat1 = {
desktop: {
label: "Desktop",
color: "#F67A28"
},
mobile: {
label: "Mobile",
color: "#E85444"
}
};
export function Stat1() {
return (
<div className="py-4 px-4">
<div className="flex flex-wrap -m-4">
<div className="p-4 w-full md:w-1/2">
<Card className="mb-8">
<CardHeader className="flex-wrap flex-row items-center justify-between space-y-0 pt-2 pb-2 gap-2">
<CardDescription>Profit</CardDescription>
<Button variant="ghost" size="icon" className="text-muted-foreground">
<Ellipsis />
</Button>
</CardHeader>
<CardContent className="flex flex-wrap items-center pb-4 gap-4">
<CardTitle className="text-3xl">$124,563.00</CardTitle>
<Badge variant="secondary" className="font-medium text-muted-foreground">+6.9%</Badge>
</CardContent>
<CardFooter className="flex-col items-start">
<Progress value={35} className="mb-2 h-1" />
<CardDescription className="text-xs text-muted-foreground">Yearly Goal</CardDescription>
</CardFooter>
</Card>
<Card>
<CardHeader className="flex-wrap flex-row items-center justify-between space-y-0 pb-2 gap-2">
<CardDescription>Visit Duration</CardDescription>
<Button variant="ghost" size="icon" className="text-muted-foreground">
<Ellipsis />
</Button>
</CardHeader>
<CardContent className="flex flex-wrap items-center pb-2 gap-4">
<CardTitle className="text-3xl">94.2%</CardTitle>
<Badge variant="secondary" className="font-medium text-muted-foreground">+6.9%</Badge>
</CardContent>
<CardFooter>
<ChartContainer config={chartContainer1_stats_stat1} className="h-[50px] w-full">
<BarChart accessibilityLayer data={chartData_stats_stat1} >
<Bar dataKey="desktop" fill="var(--color-desktop)" radius={8} />
</BarChart>
</ChartContainer>
</CardFooter>
</Card>
</div>
<div className="p-4 w-full md:w-1/2">
<Card>
<CardHeader className="flex-row flex-wrap items-center justify-between gap-4 py-4 space-y-0 border-b">
<CardTitle className="text-xl">Balance</CardTitle>
<div className="flex flex-wrap gap-3">
<Select>
<SelectTrigger className="w-[108px]">
<SelectValue placeholder="Monthly" />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectItem value="monthly">Monthly</SelectItem>
<SelectItem value="yearly">Yearly</SelectItem>
</SelectGroup>
</SelectContent>
</Select>
</div>
</CardHeader>
<CardContent className="flex flex-wrap items-center pt-2 px-4 gap-4">
<div className="flex flex-wrap w-full">
<div className="w-full md:w-1/2 p-3">
<Card>
<CardHeader>
<CardDescription className="text-xs">Earnings </CardDescription>
<div className="flex flex-wrap items-center gap-2">
<CardTitle className="text-3xl">43.41%</CardTitle>
<Badge variant="secondary" className="font-medium text-muted-foreground">+2.5%</Badge>
</div>
</CardHeader>
</Card>
</div>
<div className="w-full md:w-1/2 p-3">
<Card>
<CardHeader>
<CardDescription className="text-xs">Balance Set</CardDescription>
<div className="flex flex-wrap items-center gap-2">
<CardTitle className="text-3xl">$95,422</CardTitle>
<Badge variant="secondary" className="font-medium text-muted-foreground">+13.5%</Badge>
</div>
</CardHeader>
</Card>
</div>
</div>
</CardContent>
<CardFooter className="p-0">
<ChartContainer config={chartContainer2_stats_stat1} className="h-[200px] w-full">
<AreaChart
accessibilityLayer
data={chartData_stats_stat1}
>
<ChartTooltip
cursor={false}
content={<ChartTooltipContent indicator="dot" hideLabel />}
/>
<Area
dataKey="desktop"
type="linear"
fill="#EBEAFC"
fillOpacity={0.4}
stroke="#382CDD"
/>
</AreaChart>
</ChartContainer>
</CardFooter>
</Card>
</div>
</div>
</div>
)
}