Refactor code structure for improved readability and maintainability

main
guilherme 2025-11-25 12:14:35 -03:00
parent 1eff007617
commit 994d9580f5
4 changed files with 5358 additions and 22 deletions

View File

@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>agfrotapainelweb</title>
<title>agprotocolopainelweb</title>
</head>
<body>
<div id="root"></div>

5338
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,6 @@ import {
ChartLegendContent,
ChartTooltip,
ChartTooltipContent,
type ChartConfig,
} from '@/views/components/ui/chart';
import { Progress } from '@/views/components/ui/progress';
import { TrendingUp } from 'lucide-react';
@ -26,8 +25,10 @@ import {
PieChart,
XAxis,
} from 'recharts';
import { Header } from './views/components/header';
import type { ChartConfig } from './views/components/ui/chart';
export const description = 'A stacked bar chart with a legend';
export function App() {
@ -55,7 +56,7 @@ export function App() {
const evolutionConfig = {
price: {
label: 'Preço',
color: '#0e233d',
color: '#007cb8',
},
} satisfies ChartConfig;
@ -68,7 +69,7 @@ export function App() {
const bestPricesConfig = {
price: {
label: 'Preço',
color: '#0e233d',
color: '#007cb8',
},
} satisfies ChartConfig;
@ -82,37 +83,37 @@ export function App() {
const vehicleStatusConfig = {
active: {
label: 'Ativos',
color: '#0e233d',
color: '#007cb8',
},
maintenance: {
label: 'Manutenção',
color: '#173b63',
color: '#0ca9eb',
},
inactive: {
label: 'Inativos',
color: '#154677',
color: '#36c1fa',
},
reserved: {
label: 'Reservados',
color: '#145190',
color: '#7cd5fd',
},
} satisfies ChartConfig;
const vehicleStatusData = [
{ status: 'active', count: 45, fill: '#0e233d' },
{ status: 'maintenance', count: 12, fill: '#173b63' },
{ status: 'inactive', count: 8, fill: '#154677' },
{ status: 'reserved', count: 15, fill: '#145190' },
{ status: 'active', count: 45, fill: '#007cb8' },
{ status: 'maintenance', count: 12, fill: '#0ca9eb' },
{ status: 'inactive', count: 8, fill: '#36c1fa' },
{ status: 'reserved', count: 15, fill: '#7cd5fd' },
];
const mileageConfig = {
company: {
label: 'Frota Empresa',
color: '#0e233d',
color: '#007cb8',
},
rented: {
label: 'Frota Terceirizada',
color: '#173b63',
color: '#0ca9eb',
},
} satisfies ChartConfig;
@ -133,8 +134,7 @@ export function App() {
{stats.map((stat) => (
<Card
key={stat.title}
className="hover:shadow-md transition-shadow duration-300"
>
className="hover:shadow-md transition-shadow duration-300">
<CardHeader className="pb-2">
<CardTitle className="text-sm font-medium text-muted-foreground">
{stat.title}
@ -167,8 +167,7 @@ export function App() {
margin={{
left: 12,
right: 12,
}}
>
}}>
<CartesianGrid vertical={false} />
<XAxis
dataKey="month"
@ -270,8 +269,7 @@ export function App() {
<CardContent className="flex-1 pb-0">
<ChartContainer
config={vehicleStatusConfig}
className="[&_.recharts-pie-label-text]:fill-foreground mx-auto aspect-square max-h-[320px] pb-0"
>
className="[&_.recharts-pie-label-text]:fill-foreground mx-auto aspect-square max-h-[320px] pb-0">
<PieChart>
<ChartTooltip content={<ChartTooltipContent hideLabel />} />
<Pie

View File

@ -90,7 +90,7 @@
--bigstone-700: #145190;
--bigstone-800: #154677;
--bigstone-900: #173b63;
--bigstone-950: #0e233d;
--bigstone-950: #007cb8;
/* Cores usadas pelos gráficos */
--color-desktop: var(--bigstone-500);
@ -115,7 +115,7 @@
--card-foreground: oklch(0.145 0 0);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.145 0 0);
--primary: #0e233d;
--primary: #007cb8;
--primary-foreground: oklch(0.985 0 0);
--secondary: oklch(0.97 0 0);
--secondary-foreground: oklch(0.205 0 0);