From 3b4af2f2fbfe742f8933e7a59bde09f742742848 Mon Sep 17 00:00:00 2001 From: EugSh <127679450+EugSh1@users.noreply.github.com> Date: Tue, 11 Mar 2025 08:17:50 +0300 Subject: [PATCH] refactor: replace SimpleRadio with CheckboxWithDesc for boolean options --- src/pages/tools/string/truncate/index.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/pages/tools/string/truncate/index.tsx b/src/pages/tools/string/truncate/index.tsx index 4916694..8f60b6a 100644 --- a/src/pages/tools/string/truncate/index.tsx +++ b/src/pages/tools/string/truncate/index.tsx @@ -10,6 +10,7 @@ import ToolContent from '@components/ToolContent'; import { CardExampleType } from '@components/examples/ToolExamples'; import { ToolComponentProps } from '@tools/defineTool'; import SimpleRadio from '@components/options/SimpleRadio'; +import CheckboxWithDesc from '@components/options/CheckboxWithDesc'; const exampleCards: CardExampleType[] = [ { @@ -107,8 +108,8 @@ export default function Truncate({ title }: ToolComponentProps) { onOwnChange={(val) => updateField('maxLength', val)} type={'number'} /> - updateField('lineByLine', !values.lineByLine)} + updateField('lineByLine', val)} checked={values.lineByLine} title={'Line-by-line Truncating'} description={'Truncate each line separately.'} @@ -120,10 +121,11 @@ export default function Truncate({ title }: ToolComponentProps) { title: 'Suffix and Affix', component: ( - updateField('addIndicator', !values.addIndicator)} + updateField('addIndicator', val)} checked={values.addIndicator} title={'Add Truncation Indicator'} + description={''} />