Rename visible RFM labels to RFV
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m26s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m26s
This commit is contained in:
@@ -143,7 +143,7 @@ const Rfm = () => {
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
// RFM is calculated server-side from the selected date range.
|
||||
// RFV is calculated server-side from the selected date range.
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||
void loadRfm(dateRange);
|
||||
}, [dateRange, loadRfm]);
|
||||
@@ -248,10 +248,10 @@ const Rfm = () => {
|
||||
Cliente: client.name,
|
||||
Telefone: client.phone,
|
||||
Segmento: client.segmentLabel,
|
||||
RFM: client.rfmScore,
|
||||
RFV: client.rfmScore,
|
||||
Recencia: client.recencyScore,
|
||||
Frequencia: client.frequencyScore,
|
||||
Monetario: client.monetaryScore,
|
||||
Valor: client.monetaryScore,
|
||||
'Compra no periodo': formatPeriodRecency(client.lastPurchaseDate),
|
||||
'Pedidos no periodo': client.frequency,
|
||||
'Ticket medio no periodo (R$)': (client.frequency ? client.monetary / client.frequency : 0).toFixed(2).replace('.', ','),
|
||||
@@ -259,15 +259,15 @@ const Rfm = () => {
|
||||
'Ultima compra': formatDate(client.lastPurchaseDate)
|
||||
}));
|
||||
|
||||
exportToCSV(exportData, `rfm_${new Date().toISOString().split('T')[0]}.csv`);
|
||||
exportToCSV(exportData, `rfv_${new Date().toISOString().split('T')[0]}.csv`);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<div className="flex flex-col xl:flex-row xl:items-center justify-between gap-4">
|
||||
<div>
|
||||
<h1 className="text-2xl font-bold mb-2 text-dark-text">RFM</h1>
|
||||
<p className="text-dark-muted font-medium">Segmentação de clientes por recência, frequência e valor monetário.</p>
|
||||
<h1 className="text-2xl font-bold mb-2 text-dark-text">RFV</h1>
|
||||
<p className="text-dark-muted font-medium">Segmentação de clientes por recência, frequência e valor.</p>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col sm:flex-row flex-wrap gap-3 items-start sm:items-center">
|
||||
@@ -284,7 +284,7 @@ const Rfm = () => {
|
||||
{isLoading && (
|
||||
<div className="inline-flex items-center gap-2 rounded-xl border border-dark-border bg-dark-card px-3 py-2 text-sm font-semibold text-dark-muted">
|
||||
<Loader2 className="h-4 w-4 animate-spin text-brand-primary" />
|
||||
Atualizando RFM
|
||||
Atualizando RFV
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -292,7 +292,7 @@ const Rfm = () => {
|
||||
<div className="bg-dark-card p-6 rounded-2xl border border-dark-border shadow-sm">
|
||||
<p className="text-dark-muted text-sm font-medium mb-1">Clientes no Período</p>
|
||||
<h3 className="text-3xl font-bold text-dark-text">{clients.length}</h3>
|
||||
<p className="mt-1 text-xs font-semibold text-dark-muted">Agrupados pela tag RFM anterior</p>
|
||||
<p className="mt-1 text-xs font-semibold text-dark-muted">Agrupados pela tag RFV anterior</p>
|
||||
</div>
|
||||
<div className="bg-dark-card p-6 rounded-2xl border border-dark-border shadow-sm">
|
||||
<p className="text-dark-muted text-sm font-medium mb-1">Receita no Período</p>
|
||||
@@ -311,8 +311,8 @@ const Rfm = () => {
|
||||
<section className="bg-dark-card p-5 rounded-2xl border border-dark-border shadow-sm">
|
||||
<div className="mb-4 flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between">
|
||||
<div>
|
||||
<h2 className="text-lg font-bold text-dark-text">Matriz RFM</h2>
|
||||
<p className="text-sm font-medium text-dark-muted">Compradores do período agrupados pela tag RFM anterior ao período.</p>
|
||||
<h2 className="text-lg font-bold text-dark-text">Matriz RFV</h2>
|
||||
<p className="text-sm font-medium text-dark-muted">Compradores do período agrupados pela tag RFV anterior ao período.</p>
|
||||
</div>
|
||||
<div className="flex items-center gap-2 text-xs font-semibold text-dark-muted">
|
||||
<span>Menor prioridade</span>
|
||||
@@ -520,7 +520,7 @@ const Rfm = () => {
|
||||
<tr>
|
||||
<th className="px-6 py-4 font-bold uppercase tracking-wider text-[10px]">Cliente</th>
|
||||
<th className="px-6 py-4 font-bold uppercase tracking-wider text-[10px]">Segmento</th>
|
||||
<th className="px-6 py-4 font-bold uppercase tracking-wider text-[10px]">RFM</th>
|
||||
<th className="px-6 py-4 font-bold uppercase tracking-wider text-[10px]">RFV</th>
|
||||
<th className="px-6 py-4 font-bold uppercase tracking-wider text-[10px]">Última Compra</th>
|
||||
<th className="px-6 py-4 font-bold uppercase tracking-wider text-[10px]">Pedidos no Período</th>
|
||||
<th className="px-6 py-4 font-bold uppercase tracking-wider text-[10px]">Ticket no Período</th>
|
||||
|
||||
Reference in New Issue
Block a user