feat: updated the rule to user see the total client cost
parent
5bbafd983f
commit
3f36f908fa
|
@ -310,22 +310,24 @@ export default function TranscriptionTable() {
|
||||||
return (
|
return (
|
||||||
<div className="space-y-6">
|
<div className="space-y-6">
|
||||||
{/* Card de Informações de Custo */}
|
{/* Card de Informações de Custo */}
|
||||||
{!userIsClient && costInfo && exchangeRate && (
|
{costInfo && exchangeRate && (
|
||||||
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||||
<Card>
|
{!userIsClient && (
|
||||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
<Card>
|
||||||
<CardTitle className="text-sm font-medium">Custo Total HIT</CardTitle>
|
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||||
<Calculator className="h-4 w-4 text-muted-foreground" />
|
<CardTitle className="text-sm font-medium">Custo Total HIT</CardTitle>
|
||||||
</CardHeader>
|
<Calculator className="h-4 w-4 text-muted-foreground" />
|
||||||
<CardContent>
|
</CardHeader>
|
||||||
<div className="text-2xl font-bold text-blue-600">
|
<CardContent>
|
||||||
{formatCurrency(convertUsdToBrl(costInfo.total_cost_hit), "BRL")}
|
<div className="text-2xl font-bold text-blue-600">
|
||||||
</div>
|
{formatCurrency(convertUsdToBrl(costInfo.total_cost_hit), "BRL")}
|
||||||
<p className="text-xs text-muted-foreground">
|
</div>
|
||||||
Empresa {costInfo.company_id} • {formatCurrency(costInfo.total_cost_hit, "USD")}
|
<p className="text-xs text-muted-foreground">
|
||||||
</p>
|
Empresa {costInfo.company_id} • {formatCurrency(costInfo.total_cost_hit, "USD")}
|
||||||
</CardContent>
|
</p>
|
||||||
</Card>
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
)}
|
||||||
|
|
||||||
<Card>
|
<Card>
|
||||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||||
|
@ -342,25 +344,27 @@ export default function TranscriptionTable() {
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<Card>
|
{!userIsClient && (
|
||||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
<Card>
|
||||||
<CardTitle className="text-sm font-medium">Margem</CardTitle>
|
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||||
<TrendingUp className="h-4 w-4 text-muted-foreground" />
|
<CardTitle className="text-sm font-medium">Margem</CardTitle>
|
||||||
</CardHeader>
|
<TrendingUp className="h-4 w-4 text-muted-foreground" />
|
||||||
<CardContent>
|
</CardHeader>
|
||||||
<div className="text-2xl font-bold text-purple-600">
|
<CardContent>
|
||||||
{formatCurrency(costInfo.total_client_cost - convertUsdToBrl(costInfo.total_cost_hit), "BRL")}
|
<div className="text-2xl font-bold text-purple-600">
|
||||||
</div>
|
{formatCurrency(costInfo.total_client_cost - convertUsdToBrl(costInfo.total_cost_hit), "BRL")}
|
||||||
<p className="text-xs text-muted-foreground">
|
</div>
|
||||||
{(
|
<p className="text-xs text-muted-foreground">
|
||||||
((costInfo.total_client_cost - convertUsdToBrl(costInfo.total_cost_hit)) /
|
{(
|
||||||
costInfo.total_client_cost) *
|
((costInfo.total_client_cost - convertUsdToBrl(costInfo.total_cost_hit)) /
|
||||||
100
|
costInfo.total_client_cost) *
|
||||||
).toFixed(1)}
|
100
|
||||||
% de margem
|
).toFixed(1)}
|
||||||
</p>
|
% de margem
|
||||||
</CardContent>
|
</p>
|
||||||
</Card>
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
@ -492,8 +496,8 @@ export default function TranscriptionTable() {
|
||||||
<TableHead>Preço Final LLM ($)</TableHead>
|
<TableHead>Preço Final LLM ($)</TableHead>
|
||||||
<TableHead>Provider LLM</TableHead>
|
<TableHead>Provider LLM</TableHead>
|
||||||
{/* <TableHead>Model TTS</TableHead> */}
|
{/* <TableHead>Model TTS</TableHead> */}
|
||||||
<TableHead>Provider STT</TableHead>
|
<TableHead>Provider TTS</TableHead>
|
||||||
<TableHead>Preço Final STT ($)</TableHead>
|
<TableHead>Preço Final TTS ($)</TableHead>
|
||||||
<TableHead>Segundos Transcritos</TableHead>
|
<TableHead>Segundos Transcritos</TableHead>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
|
|
Loading…
Reference in New Issue