|
|
|
@ -15,7 +15,6 @@ export default function AIStatus(props: AIStatusProps) { |
|
|
|
|
const run = async () => { |
|
|
|
|
props.plugin.on('fileManager', 'currentFileChanged', async (isAiActive) => { |
|
|
|
|
const aiActivate = await props.plugin.call('settings', 'get', 'settings/copilot/suggest/activate') |
|
|
|
|
console.log('copilot active', aiActivate) |
|
|
|
|
setCopilotActive(aiActivate) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
@ -24,17 +23,15 @@ export default function AIStatus(props: AIStatusProps) { |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
const run = async () => { |
|
|
|
|
props.plugin.on('filePanel', 'workspaceInitializationCompleted', async (work) => { |
|
|
|
|
const aiActivate = await props.plugin.call('settings', 'get', 'settings/copilot/suggest/activate') |
|
|
|
|
const active = await props.plugin.isAIActive(aiActivate) |
|
|
|
|
setCopilotActive(active) |
|
|
|
|
props.plugin.on('settings', 'copilotChoiceUpdated', async (isChecked) => { |
|
|
|
|
await props.plugin.isAIActive() |
|
|
|
|
setCopilotActive(isChecked) |
|
|
|
|
}) |
|
|
|
|
console.log('copilot active', copilotActive) |
|
|
|
|
} |
|
|
|
|
run() |
|
|
|
|
}, [props.plugin.isAiActive]) |
|
|
|
|
return ( |
|
|
|
|
<div className="d-flex flex-row p-1 text-white justify-content-center align-items-center"> |
|
|
|
|
<div className="d-flex flex-row pr-2 text-white justify-content-center align-items-center"> |
|
|
|
|
<span className={copilotActive === false ? "fa-regular fa-microchip-ai ml-1 text-danger" : "fa-regular fa-microchip-ai ml-1"}></span> |
|
|
|
|
<span className={copilotActive === false ? "small mx-1 text-danger" : "small mx-1" }>Remix Copilot</span> |
|
|
|
|
</div> |
|
|
|
|