chore: show tooloptions in example

This commit is contained in:
Ibrahima G. Coulibaly
2025-02-27 01:26:48 +00:00
parent a03df0a4e8
commit ff05de4ab6
6 changed files with 143 additions and 194 deletions

View File

@@ -1,32 +1,33 @@
import { Box, Grid, Stack, Typography } from '@mui/material';
import ExampleCard from './ExampleCard';
import React from 'react';
import { GetGroupsType } from '@components/options/ToolOptions';
export interface ExampleCardProps {
export interface ExampleCardProps<T> {
title: string;
description: string;
sampleText: string;
sampleResult: string;
requiredOptions: RequiredOptionsProps;
requiredOptions: T;
changeInputResult: (input: string, result: string) => void;
getGroups: GetGroupsType<T>;
}
interface ExampleProps<T> {
title: string;
subtitle: string;
exampleCards: ExampleCardProps<T>[];
getGroups: GetGroupsType<T>;
changeInputResult: (input: string, result: string) => void;
}
export interface RequiredOptionsProps {
joinCharacter: string;
deleteBlankLines: boolean;
deleteTrailingSpaces: boolean;
}
interface ExampleProps {
title: string;
subtitle: string;
exampleCards: ExampleCardProps[];
}
export default function Examples({
export default function Examples<T>({
title,
subtitle,
exampleCards
}: ExampleProps) {
exampleCards,
getGroups,
changeInputResult
}: ExampleProps<T>) {
return (
<Box id={'examples'} mt={4}>
<Box mt={4} display="flex" gap={1} alignItems="center">
@@ -48,7 +49,8 @@ export default function Examples({
sampleText={card.sampleText}
sampleResult={card.sampleResult}
requiredOptions={card.requiredOptions}
changeInputResult={card.changeInputResult}
getGroups={getGroups}
changeInputResult={changeInputResult}
/>
</Grid>
))}