mirror of
https://github.com/spliit-app/spliit.git
synced 2026-03-09 05:39:06 +01:00
* Use tRPC in group edition + group layout * Use tRPC in group modals * Use tRPC in group stats * Use tRPC in group activity
29 lines
671 B
TypeScript
29 lines
671 B
TypeScript
'use client'
|
|
import { cn, formatCurrency } from '@/lib/utils'
|
|
import { useLocale, useTranslations } from 'next-intl'
|
|
|
|
export function TotalsYourShare({
|
|
totalParticipantShare = 0,
|
|
currency,
|
|
}: {
|
|
totalParticipantShare?: number
|
|
currency: string
|
|
}) {
|
|
const locale = useLocale()
|
|
const t = useTranslations('Stats.Totals')
|
|
|
|
return (
|
|
<div>
|
|
<div className="text-muted-foreground">{t('yourShare')}</div>
|
|
<div
|
|
className={cn(
|
|
'text-lg',
|
|
totalParticipantShare < 0 ? 'text-green-600' : 'text-red-600',
|
|
)}
|
|
>
|
|
{formatCurrency(currency, Math.abs(totalParticipantShare), locale)}
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|