|
|
@ -15,13 +15,13 @@ export default function AIStatus(props: AIStatusProps) { |
|
|
|
const [copilotActive, setCopilotActive] = useState(false) |
|
|
|
const [copilotActive, setCopilotActive] = useState(false) |
|
|
|
const appContext = useContext(AppContext) |
|
|
|
const appContext = useContext(AppContext) |
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
|
|
|
|
|
|
|
|
const run = async () => { |
|
|
|
const run = async () => { |
|
|
|
const aiActivate = await props.plugin.call('settings', 'get', 'settings/copilot/suggest/activate') |
|
|
|
const aiActivate = await props.plugin.call('settings', 'get', 'settings/copilot/suggest/activate') |
|
|
|
setCopilotActive(aiActivate) |
|
|
|
setCopilotActive(aiActivate) |
|
|
|
} |
|
|
|
} |
|
|
|
run() |
|
|
|
run() |
|
|
|
|
|
|
|
|
|
|
|
}, []) |
|
|
|
}, []) |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
@ -40,7 +40,7 @@ export default function AIStatus(props: AIStatusProps) { |
|
|
|
tooltipText={copilotActive ? "Disable RemixAI Copilot" : "Enable RemixAI Copilot. Switch to .sol file to try it."} |
|
|
|
tooltipText={copilotActive ? "Disable RemixAI Copilot" : "Enable RemixAI Copilot. Switch to .sol file to try it."} |
|
|
|
> |
|
|
|
> |
|
|
|
<span |
|
|
|
<span |
|
|
|
style={{cursor: 'pointer'}} |
|
|
|
style={{ cursor: 'pointer' }} |
|
|
|
className={"small mx-1 bg-info border-0 text-white " + (copilotActive === false ? "semi-bold" : "")} |
|
|
|
className={"small mx-1 bg-info border-0 text-white " + (copilotActive === false ? "semi-bold" : "")} |
|
|
|
onClick={async () => { |
|
|
|
onClick={async () => { |
|
|
|
await props.plugin.call('settings' as any, 'updateCopilotChoice', !copilotActive) |
|
|
|
await props.plugin.call('settings' as any, 'updateCopilotChoice', !copilotActive) |
|
|
|