mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
re-structure to monorepo.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
// @ts-nocheck
|
||||
import React from 'react';
|
||||
import { FInputGroup } from '@/components';
|
||||
import { useFormikContext } from 'formik';
|
||||
|
||||
export function FInputGroupComponent({ toField, ...props }) {
|
||||
const { values, setFieldValue } = useFormikContext();
|
||||
const { expenseQuantity, expenseUnitPrice } = values;
|
||||
const total = expenseQuantity * expenseUnitPrice;
|
||||
|
||||
const handleBlur = () => {
|
||||
setFieldValue(toField, total);
|
||||
};
|
||||
|
||||
const inputGroupProps = {
|
||||
onBlur: handleBlur,
|
||||
...props,
|
||||
};
|
||||
return <FInputGroup {...inputGroupProps} />;
|
||||
}
|
||||
Reference in New Issue
Block a user