Files
archived-orca/src/renderer/src/components/feature-wall/BrowserUseSkillSetupCard.tsx
T
Neil ef27841e29 refactor: group agent launch, status, and messaging owners (#40313)
* refactor: group agent launch, status, and messaging owners

* refactor: consolidate direct owner imports

* refactor: import pane ownership directly in status listeners
2026-11-09 04:24:18 -08:00

51 lines
2.0 KiB
TypeScript

import type { JSX } from 'react'
import { ORCA_CLI_SKILL_NAME } from '@/lib/skills/installation/agent-feature-skill-names'
import { BROWSER_USE_ENABLED_STORAGE_KEY } from '@/lib/browser/browser-use-setup-state'
import type { InstalledAgentSkillState } from '@/hooks/useInstalledAgentSkills'
import { useActiveProjectSkillRuntime } from '@/hooks/useActiveProjectSkillRuntime'
import { AgentSkillSetupPanel } from '@/components/skills/setup/AgentSkillSetupPanel'
import { useAppStore } from '@/store'
import { useTranslate } from '@/i18n/use-translate'
export function BrowserUseSkillSetupCard(props: {
compact?: boolean
skill: InstalledAgentSkillState
}): JSX.Element {
const t = useTranslate()
const { compact, skill } = props
const activeSkillRuntime = useActiveProjectSkillRuntime()
const handleBeforeInstall = (): void => {
useAppStore.getState().recordFeatureInteraction('agent-browser-setup')
localStorage.setItem(BROWSER_USE_ENABLED_STORAGE_KEY, '1')
}
const setupPanel = (
<AgentSkillSetupPanel
className={compact ? 'w-full max-w-[520px]' : undefined}
title={t(
'auto.components.feature.wall.BrowserUseSkillSetupCard.d5bb1cd4ba',
'Browser Use skill'
)}
description={t(
'auto.components.feature.wall.BrowserUseSkillSetupCard.cbc45022d4',
"Enables agents to navigate and verify pages in Orca's browser."
)}
skillNames={[ORCA_CLI_SKILL_NAME]}
installed={skill.installed}
loading={skill.loading}
error={activeSkillRuntime.installDisabledReason ?? skill.error}
installDisabled={Boolean(activeSkillRuntime.installDisabledReason)}
onBeforeInstall={handleBeforeInstall}
showRecheckWhenInstalled={false}
onRecheck={skill.refresh}
freshnessSkillName={activeSkillRuntime.canUseSkillFreshness ? ORCA_CLI_SKILL_NAME : undefined}
/>
)
if (compact) {
return <div className="flex min-h-24 flex-1 items-center justify-center pt-3">{setupPanel}</div>
}
return <div className="flex">{setupPanel}</div>
}