diff --git a/src/components/OptionsSection.tsx b/src/components/OptionsSection.tsx index b0ba1cd..6559b37 100644 --- a/src/components/OptionsSection.tsx +++ b/src/components/OptionsSection.tsx @@ -1,5 +1,5 @@ import { Chip, Textarea, Tooltip } from '@nextui-org/react' -import { XIcon } from 'lucide-react' +import { LockKeyholeIcon, LockOpenIcon, XIcon } from 'lucide-react' import { useCallback, useEffect, useState } from 'react' import { replaceSmartQuotes } from '../../lib/format' @@ -9,12 +9,16 @@ export default function OptionsSection({ globalOptions, optionsFetcher, rows = 14, + isLocked, + setIsLocked, }: { optionsJson: string setOptionsJson: (value: string) => void globalOptions: any[] optionsFetcher: () => Promise rows?: number + isLocked?: boolean + setIsLocked?: (value: boolean) => void }) { const [copyAvailableOptions, setCopyAvailableOptions] = useState([]) @@ -87,6 +91,24 @@ export default function OptionsSection({ onClear={() => { setOptionsJson('{}') }} + endContent={ + setIsLocked && ( + + {isLocked ? ( + setIsLocked(false)} + /> + ) : ( + setIsLocked(true)} + /> + )} + + ) + } + data-focus-visible="false" />