mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-19 14:09:31 +02:00
feat: generate Numbers
This commit is contained in:
@@ -5,15 +5,17 @@ export default function ToolInputAndResult({
|
||||
input,
|
||||
result
|
||||
}: {
|
||||
input: ReactNode;
|
||||
input?: ReactNode;
|
||||
result: ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<Grid id="tool" container spacing={2}>
|
||||
<Grid item xs={12} md={6}>
|
||||
{input}
|
||||
</Grid>
|
||||
<Grid item xs={12} md={6}>
|
||||
{input && (
|
||||
<Grid item xs={12} md={6}>
|
||||
{input}
|
||||
</Grid>
|
||||
)}
|
||||
<Grid item xs={12} md={input ? 6 : 12}>
|
||||
{result}
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
@@ -20,7 +20,7 @@ const FormikListenerComponent = <T,>({
|
||||
|
||||
useEffect(() => {
|
||||
try {
|
||||
if (values && input) compute(values, input);
|
||||
compute(values, input);
|
||||
} catch (exception: unknown) {
|
||||
if (exception instanceof Error) showSnackBar(exception.message, 'error');
|
||||
}
|
||||
@@ -41,7 +41,7 @@ export default function ToolOptions<T extends FormikValues>({
|
||||
initialValues: T;
|
||||
validationSchema: any | (() => any);
|
||||
compute: (optionsValues: T, input: any) => void;
|
||||
input: any;
|
||||
input?: any;
|
||||
getGroups: (formikProps: FormikProps<T>) => ToolOptionGroup[];
|
||||
formRef?: RefObject<FormikProps<T>>;
|
||||
}) {
|
||||
|
Reference in New Issue
Block a user