mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-19 14:09:31 +02:00
feat: arithmetic sequence
This commit is contained in:
@@ -10,7 +10,7 @@ import ToolExamples, {
|
||||
} from '@components/examples/ToolExamples';
|
||||
import { ToolComponentProps } from '@tools/defineTool';
|
||||
|
||||
interface ToolContentPropsBase<T, I> extends ToolComponentProps {
|
||||
interface ToolContentProps<T, I> extends ToolComponentProps {
|
||||
// Input/Output components
|
||||
inputComponent: ReactNode;
|
||||
resultComponent: ReactNode;
|
||||
@@ -29,28 +29,15 @@ interface ToolContentPropsBase<T, I> extends ToolComponentProps {
|
||||
};
|
||||
|
||||
// Input value to pass to the compute function
|
||||
input: I;
|
||||
input?: I;
|
||||
|
||||
exampleCards?: CardExampleType<T>[];
|
||||
setInput?: React.Dispatch<React.SetStateAction<I>>;
|
||||
|
||||
// Validation schema (optional)
|
||||
validationSchema?: any;
|
||||
}
|
||||
|
||||
interface ToolContentPropsWithExamples<T, I>
|
||||
extends ToolContentPropsBase<T, I> {
|
||||
exampleCards: CardExampleType<T>[];
|
||||
setInput: React.Dispatch<React.SetStateAction<I>>;
|
||||
}
|
||||
|
||||
interface ToolContentPropsWithoutExamples<T, I>
|
||||
extends ToolContentPropsBase<T, I> {
|
||||
exampleCards?: never;
|
||||
setInput?: never;
|
||||
}
|
||||
|
||||
type ToolContentProps<T, I> =
|
||||
| ToolContentPropsWithExamples<T, I>
|
||||
| ToolContentPropsWithoutExamples<T, I>;
|
||||
|
||||
export default function ToolContent<T extends FormikValues, I>({
|
||||
title,
|
||||
inputComponent,
|
||||
|
Reference in New Issue
Block a user