File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
apps/xen-tg-app/src/components Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 1- import { FC , useMemo } from 'react'
1+ import { FC , useEffect , useMemo } from 'react'
22// import UnlinkOutlineIcon from '../assets/unlink-outline'
33import ArrowForwardIcon from '@/assets/arrow-forward'
44import { Switch } from '@/components/ui/switch'
@@ -65,6 +65,8 @@ const Agent: FC<TAgentProps> = ({ capabilitiy }) => {
6565 } ,
6666 } )
6767
68+ useEffect ( ( ) => handleToggleCapability . reset ( ) , [ capabilitiy ] )
69+
6870 // const handleRemoveCapability = useMutation({
6971 // mutationFn,
7072 // onSuccess: () => {
@@ -90,7 +92,11 @@ const Agent: FC<TAgentProps> = ({ capabilitiy }) => {
9092 </ div >
9193 </ button >
9294
93- < Switch onCheckedChange = { handleChangeStatus } checked = { capabilitiy . isEnabled } />
95+ < Switch
96+ onCheckedChange = { handleChangeStatus }
97+ checked = { capabilitiy . isEnabled }
98+ disabled = { handleToggleCapability . isPending || handleToggleCapability . isSuccess }
99+ />
94100 { /* <button
95101 className="mr-1 flex cursor-pointer p-1.5 text-[#7A818B] transition hover:text-(--color-main-text)"
96102 onClick={() =>
You can’t perform that action at this time.
0 commit comments