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