mirror of
https://github.com/spliit-app/spliit.git
synced 2026-02-20 06:26:13 +01:00
* I18n with next-intl * package-lock * Finnish translations * Development fix * Use locale for positioning currency symbol * Translations: Expenses.ActiveUserModal * Translations: group 404 * Better translation for ExpenseCard * Apply translations in CategorySelect search * Fix for Finnish translation * Translations for ExpenseDocumentsInput * Translations for CreateFromReceipt * Fix for Finnish translation * Translations for schema errors * Fix for Finnish translation * Fixes for Finnish translations * Prettier --------- Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
34 lines
605 B
TypeScript
34 lines
605 B
TypeScript
'use client'
|
|
import { cn, formatCurrency } from '@/lib/utils'
|
|
import { useLocale } from 'next-intl'
|
|
|
|
type Props = {
|
|
currency: string
|
|
amount: number
|
|
bold?: boolean
|
|
colored?: boolean
|
|
}
|
|
|
|
export function Money({
|
|
currency,
|
|
amount,
|
|
bold = false,
|
|
colored = false,
|
|
}: Props) {
|
|
const locale = useLocale()
|
|
return (
|
|
<span
|
|
className={cn(
|
|
colored && amount <= 1
|
|
? 'text-red-600'
|
|
: colored && amount >= 1
|
|
? 'text-green-600'
|
|
: '',
|
|
bold && 'font-bold',
|
|
)}
|
|
>
|
|
{formatCurrency(currency, amount, locale)}
|
|
</span>
|
|
)
|
|
}
|