feat: Enhance provider components with detailed documentation and comments
- Added comprehensive comments and JSDoc-style documentation to NotificationProvider, ThemeProvider, UserProvider, and WebsiteThemeProvider for better clarity and maintainability. - Improved type definitions in index.ts for better code understanding and usage. - Introduced Docker support with Dockerfiles for various services including AI server, signaling server, and browser-use service. - Created a docker-compose.yml file to orchestrate multiple services including PostgreSQL, AI, scraper, and frontend. - Added a startup guide (startup.txt) for setting up the CRM environment on Ubuntu with Docker. - Included a .dockerignore file to exclude unnecessary files from Docker builds.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
// ── Dashboard: Leads Per Month Bar Chart ──
|
||||
// Interactive SVG bar chart comparing new leads vs. closed leads per month.
|
||||
// Supports year navigation, hover tooltip with close rate, and gradient-filled bars.
|
||||
|
||||
"use client"
|
||||
|
||||
import { useState, useMemo, useEffect } from "react"
|
||||
@@ -6,6 +10,7 @@ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { ChevronLeft, ChevronRight } from "lucide-react"
|
||||
|
||||
/** A single month's data point */
|
||||
interface IntervalData {
|
||||
label: string
|
||||
leads: number
|
||||
@@ -16,9 +21,15 @@ interface LeadsPerMonthChartProps {
|
||||
data: IntervalData[]
|
||||
}
|
||||
|
||||
/** Color constants for new leads and closed bars */
|
||||
const NEW_LEADS = "#C84B4B"
|
||||
const CLOSED = "#5A8FC4"
|
||||
|
||||
/**
|
||||
* LeadsPerMonthChart — bar chart rendered with SVG.
|
||||
* Features: year navigation, hover highlight/tooltip, legend, gradient fills,
|
||||
* grid lines with tick labels, and summary stats (total new, total closed, close rate).
|
||||
*/
|
||||
export function LeadsPerMonthChart({ data: initialData }: LeadsPerMonthChartProps) {
|
||||
const [year, setYear] = useState(new Date().getFullYear())
|
||||
const [chartData, setChartData] = useState<IntervalData[]>(initialData)
|
||||
|
||||
Reference in New Issue
Block a user