refactor(top-estabelecimentos): atualiza layout e usa componente Progress
- Cria layout.tsx com PageDescription - Substitui barras de progresso customizadas por Progress - Remove label 'Período:' do filtro - Ajusta espaçamento do filtro na página
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
"use client";
|
||||
|
||||
import MoneyValues from "@/components/money-values";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import MoneyValues from "@/components/money-values";
|
||||
import { WidgetEmptyState } from "@/components/widget-empty-state";
|
||||
import type { TopEstabelecimentosData } from "@/lib/top-estabelecimentos/fetch-data";
|
||||
import { title_font } from "@/public/fonts/font_index";
|
||||
import { RiStore2Line } from "@remixicon/react";
|
||||
import { Progress } from "../ui/progress";
|
||||
|
||||
type EstablishmentsListProps = {
|
||||
establishments: TopEstabelecimentosData["establishments"];
|
||||
@@ -119,14 +120,10 @@ export function EstablishmentsList({
|
||||
|
||||
{/* Progress bar */}
|
||||
<div className="ml-12 mt-1.5">
|
||||
<div className="h-1.5 bg-muted rounded-full overflow-hidden">
|
||||
<div
|
||||
className="h-full bg-primary/50 rounded-full"
|
||||
style={{
|
||||
width: `${(establishment.count / maxCount) * 100}%`,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<Progress
|
||||
className="h-1.5"
|
||||
value={(establishment.count / maxCount) * 100}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -27,7 +27,7 @@ export function PeriodFilterButtons({ currentFilter }: PeriodFilterProps) {
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-sm text-muted-foreground">Período:</span>
|
||||
|
||||
<div className="flex items-center gap-1">
|
||||
{filterOptions.map((option) => (
|
||||
<Button
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
import { getIconComponent } from "@/lib/utils/icons";
|
||||
import { title_font } from "@/public/fonts/font_index";
|
||||
import { RiPriceTag3Line } from "@remixicon/react";
|
||||
import { Progress } from "../ui/progress";
|
||||
|
||||
type TopCategoriesProps = {
|
||||
categories: TopEstabelecimentosData["topCategories"];
|
||||
@@ -110,15 +111,7 @@ export function TopCategories({ categories }: TopCategoriesProps) {
|
||||
|
||||
{/* Progress bar */}
|
||||
<div className="ml-12 mt-1.5">
|
||||
<div className="h-1.5 bg-muted rounded-full overflow-hidden">
|
||||
<div
|
||||
className="h-full rounded-full"
|
||||
style={{
|
||||
width: `${percent}%`,
|
||||
backgroundColor: color,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<Progress className="h-1.5" value={percent} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user