refactor(FE): Add tooltip and allow 3-decimal weight input

This commit is contained in:
rstubryan
2026-01-22 14:46:38 +07:00
parent 49e9e958fa
commit 9d6148e877
@@ -23,6 +23,7 @@ import ConfirmationModalWithNotes from '@/components/modal/ConfirmationModalWith
import Modal, { useModal } from '@/components/Modal'; import Modal, { useModal } from '@/components/Modal';
import AlertErrorList from '@/components/helper/form/FormErrors'; import AlertErrorList from '@/components/helper/form/FormErrors';
import Table from '@/components/Table'; import Table from '@/components/Table';
import Tooltip from '@/components/Tooltip';
import { type ColumnDef } from '@tanstack/react-table'; import { type ColumnDef } from '@tanstack/react-table';
import { import {
@@ -2816,7 +2817,23 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
)} )}
<th>Kondisi Telur</th> <th>Kondisi Telur</th>
<th>Jumlah</th> <th>Jumlah</th>
<th>Total Berat (Kilogram)</th> <th className='flex items-center gap-1'>
Total Berat (Kilogram)
<Tooltip
className={{
wrapper: 'cursor-pointer',
}}
position='bottom'
content='Untuk menggunakan koma bisa menekan tombol titik (.) pada keyboard, Misal 0.123'
>
<Icon
icon='heroicons:information-circle'
width={20}
height={20}
className='text-gray-400 hover:text-gray-600 shrink-0'
/>
</Tooltip>
</th>
{(type as 'add' | 'edit' | 'detail') !== 'detail' && ( {(type as 'add' | 'edit' | 'detail') !== 'detail' && (
<th>Action</th> <th>Action</th>
)} )}
@@ -2922,7 +2939,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
value={egg.weight ?? ''} value={egg.weight ?? ''}
onChange={handleEggWeightChangeWrapper(idx)} onChange={handleEggWeightChangeWrapper(idx)}
onBlur={formik.handleBlur} onBlur={formik.handleBlur}
decimalScale={0} decimalScale={3}
allowNegative={false} allowNegative={false}
thousandSeparator=',' thousandSeparator=','
decimalSeparator='.' decimalSeparator='.'