Clean seller metadata display names
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 40s

This commit is contained in:
Cauê Faleiros
2026-06-24 13:03:55 -03:00
parent b129307bae
commit ca9615a1fd
5 changed files with 57 additions and 13 deletions

View File

@@ -5,6 +5,7 @@ import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContaine
import DateRangePicker from '../components/DateRangePicker';
import type { ClientDetailsAnalytics, DateRange, OrderData } from '../types';
import { fetchClientDetailsAnalytics } from '../dataService';
import { formatDisplayName, removeTrailingSellerId } from '../displayFormatters';
type CustomTooltipProps = {
active?: boolean;
@@ -27,14 +28,11 @@ const CustomTooltip = ({ active, payload, label }: CustomTooltipProps) => {
};
const getOrderMetadata = (order: OrderData) => {
const seller = [
order.nome_vendedor,
order.id_vendedor ? `#${order.id_vendedor}` : ''
].filter(Boolean).join(' ');
const sellerName = formatDisplayName(removeTrailingSellerId(order.nome_vendedor || ''));
return [
order.cliente_nome_fantasia ? `Fantasia: ${order.cliente_nome_fantasia}` : '',
seller ? `Vendedor: ${seller}` : '',
order.cliente_nome_fantasia ? `Fantasia: ${formatDisplayName(order.cliente_nome_fantasia)}` : '',
sellerName ? `Vendedor: ${sellerName}` : '',
order.marketplace ? `Marketplace: ${order.marketplace}` : '',
order.canal_venda ? `Canal: ${order.canal_venda}` : '',
order.numero_ecommerce ? `E-commerce: ${order.numero_ecommerce}` : ''