|
@@ -11,7 +11,8 @@ import {
|
|
|
DropdownMenuItem,
|
|
DropdownMenuItem,
|
|
|
DropdownMenuTrigger,
|
|
DropdownMenuTrigger,
|
|
|
} from '@/components/ui/dropdown-menu'
|
|
} from '@/components/ui/dropdown-menu'
|
|
|
-import { formatCurrency, getCurrencySymbol } from '@/lib/format'
|
|
|
|
|
|
|
+import { getCurrencySymbol } from '@/lib/format'
|
|
|
|
|
+import { useFormatCurrency, useCurrencySettings } from '@/components/currency-settings-context'
|
|
|
import { useTranslations } from 'next-intl'
|
|
import { useTranslations } from 'next-intl'
|
|
|
import type { ServiceLaborInput } from '@/features/vehicles/Schema/serviceSchema'
|
|
import type { ServiceLaborInput } from '@/features/vehicles/Schema/serviceSchema'
|
|
|
import { makeEmptyLabor, makeEmptyService } from './form-types'
|
|
import { makeEmptyLabor, makeEmptyService } from './form-types'
|
|
@@ -66,6 +67,7 @@ function SortableLaborRow({
|
|
|
t: (key: string) => string
|
|
t: (key: string) => string
|
|
|
dragEnabled: boolean
|
|
dragEnabled: boolean
|
|
|
}) {
|
|
}) {
|
|
|
|
|
+ const formatCurrency = useFormatCurrency()
|
|
|
const {
|
|
const {
|
|
|
attributes,
|
|
attributes,
|
|
|
listeners,
|
|
listeners,
|
|
@@ -164,7 +166,9 @@ export function LaborEditor({
|
|
|
onShowExistingObservations,
|
|
onShowExistingObservations,
|
|
|
}: LaborEditorProps) {
|
|
}: LaborEditorProps) {
|
|
|
const t = useTranslations('service.labor')
|
|
const t = useTranslations('service.labor')
|
|
|
- const cs = getCurrencySymbol(currencyCode)
|
|
|
|
|
|
|
+ const formatCurrency = useFormatCurrency()
|
|
|
|
|
+ const { currencyFormat } = useCurrencySettings()
|
|
|
|
|
+ const cs = getCurrencySymbol(currencyCode, currencyFormat)
|
|
|
const [mounted, setMounted] = useState(false)
|
|
const [mounted, setMounted] = useState(false)
|
|
|
useEffect(() => setMounted(true), [])
|
|
useEffect(() => setMounted(true), [])
|
|
|
const keyCounterRef = useRef(0)
|
|
const keyCounterRef = useRef(0)
|