mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-19 05:59:34 +02:00
refactor: replace SimpleRadio with CheckboxWithDesc for boolean options
This commit is contained in:
@@ -10,6 +10,7 @@ import ToolContent from '@components/ToolContent';
|
|||||||
import { CardExampleType } from '@components/examples/ToolExamples';
|
import { CardExampleType } from '@components/examples/ToolExamples';
|
||||||
import { ToolComponentProps } from '@tools/defineTool';
|
import { ToolComponentProps } from '@tools/defineTool';
|
||||||
import SimpleRadio from '@components/options/SimpleRadio';
|
import SimpleRadio from '@components/options/SimpleRadio';
|
||||||
|
import CheckboxWithDesc from '@components/options/CheckboxWithDesc';
|
||||||
|
|
||||||
const exampleCards: CardExampleType<InitialValuesType>[] = [
|
const exampleCards: CardExampleType<InitialValuesType>[] = [
|
||||||
{
|
{
|
||||||
@@ -107,8 +108,8 @@ export default function Truncate({ title }: ToolComponentProps) {
|
|||||||
onOwnChange={(val) => updateField('maxLength', val)}
|
onOwnChange={(val) => updateField('maxLength', val)}
|
||||||
type={'number'}
|
type={'number'}
|
||||||
/>
|
/>
|
||||||
<SimpleRadio
|
<CheckboxWithDesc
|
||||||
onClick={() => updateField('lineByLine', !values.lineByLine)}
|
onChange={(val) => updateField('lineByLine', val)}
|
||||||
checked={values.lineByLine}
|
checked={values.lineByLine}
|
||||||
title={'Line-by-line Truncating'}
|
title={'Line-by-line Truncating'}
|
||||||
description={'Truncate each line separately.'}
|
description={'Truncate each line separately.'}
|
||||||
@@ -120,10 +121,11 @@ export default function Truncate({ title }: ToolComponentProps) {
|
|||||||
title: 'Suffix and Affix',
|
title: 'Suffix and Affix',
|
||||||
component: (
|
component: (
|
||||||
<Box>
|
<Box>
|
||||||
<SimpleRadio
|
<CheckboxWithDesc
|
||||||
onClick={() => updateField('addIndicator', !values.addIndicator)}
|
onChange={(val) => updateField('addIndicator', val)}
|
||||||
checked={values.addIndicator}
|
checked={values.addIndicator}
|
||||||
title={'Add Truncation Indicator'}
|
title={'Add Truncation Indicator'}
|
||||||
|
description={''}
|
||||||
/>
|
/>
|
||||||
<TextFieldWithDesc
|
<TextFieldWithDesc
|
||||||
description={
|
description={
|
||||||
|
Reference in New Issue
Block a user