feat: translate CSV export headers to pt-BR and format currency values
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m3s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m3s
This commit is contained in:
@@ -91,7 +91,16 @@ const Products = () => {
|
||||
</div>
|
||||
|
||||
<button
|
||||
onClick={() => exportToCSV(productsData, `produtos_${new Date().toISOString().split('T')[0]}.csv`)}
|
||||
onClick={() => {
|
||||
const exportData = productsData.map(product => ({
|
||||
'ID Produto': product.id,
|
||||
'Descrição': product.name,
|
||||
'Preço Atual (R$)': product.lastPrice.toFixed(2).replace('.', ','),
|
||||
'Total Vendido (un.)': product.totalSold,
|
||||
'Receita Gerada (R$)': product.revenue.toFixed(2).replace('.', ',')
|
||||
}));
|
||||
exportToCSV(exportData, `produtos_${new Date().toISOString().split('T')[0]}.csv`);
|
||||
}}
|
||||
className="flex items-center justify-center gap-2 bg-dark-card border border-dark-border px-4 py-2.5 rounded-xl shadow-sm hover:border-brand-primary transition-colors text-sm font-medium text-dark-text cursor-pointer"
|
||||
title="Exportar para CSV"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user