refactor: use ToolContent

This commit is contained in:
Ibrahima G. Coulibaly
2025-03-09 01:22:23 +00:00
parent a279c442ec
commit 8661fabe7d
8 changed files with 151 additions and 134 deletions

View File

@@ -6,6 +6,7 @@ import TextFieldWithDesc from '@components/options/TextFieldWithDesc';
import { generateArithmeticSequence } from './service';
import * as Yup from 'yup';
import { CardExampleType } from '@components/examples/ToolExamples';
import { ToolComponentProps } from '@tools/defineTool';
type InitialValuesType = {
firstTerm: string;
@@ -68,11 +69,12 @@ const exampleCards: CardExampleType<InitialValuesType>[] = [
}
];
export default function ArithmeticSequence() {
export default function ArithmeticSequence({ title }: ToolComponentProps) {
const [result, setResult] = useState<string>('');
return (
<ToolContent
title={title}
inputComponent={null}
resultComponent={
<ToolTextResult title="Generated Sequence" value={result} />