Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions app/src/components/skills/SkillCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export interface UnifiedSkillCardProps {
metricsText?: string;
};
syncSummaryText?: string;
ctaDisabled?: boolean;
}

const CTA_STYLES: Record<string, string> = {
Expand All @@ -60,6 +61,7 @@ export function UnifiedSkillCard({
secondaryActions,
syncProgress,
syncSummaryText,
ctaDisabled,
}: UnifiedSkillCardProps) {
const [menuOpen, setMenuOpen] = useState(false);
const menuRef = useRef<HTMLDivElement>(null);
Expand Down Expand Up @@ -164,11 +166,12 @@ export function UnifiedSkillCard({
)}
<button
type="button"
disabled={ctaDisabled}
onClick={e => {
e.stopPropagation();
onCtaClick();
}}
className={`flex-shrink-0 rounded-lg border px-3 py-1.5 text-[11px] font-medium transition-colors ${ctaStyle}`}>
className={`flex-shrink-0 rounded-lg border px-3 py-1.5 text-[11px] font-medium transition-colors ${ctaStyle} ${ctaDisabled ? 'opacity-50 cursor-not-allowed' : ''}`}>
{ctaLabel}
</button>
</div>
Expand All @@ -180,9 +183,10 @@ export function UnifiedSkillCard({
interface ThirdPartySkillCardProps {
skill: SkillListEntry;
onSetup: () => void;
isInstalling?: boolean;
}

export function ThirdPartySkillCard({ skill, onSetup }: ThirdPartySkillCardProps) {
export function ThirdPartySkillCard({ skill, onSetup, isInstalling }: ThirdPartySkillCardProps) {
const connectionStatus = useSkillConnectionStatus(skill.id);
const statusDisplay = STATUS_DISPLAY[connectionStatus] ?? STATUS_DISPLAY.offline;
const skillState = useSkillState<SkillHostConnectionState & Record<string, unknown>>(skill.id);
Expand Down Expand Up @@ -239,6 +243,7 @@ export function ThirdPartySkillCard({ skill, onSetup }: ThirdPartySkillCardProps
}

function ctaLabel(): string {
if (isInstalling) return 'Enabling...';
switch (connectionStatus) {
case 'offline': return 'Enable';
case 'setup_required': return 'Setup';
Expand Down Expand Up @@ -305,6 +310,7 @@ export function ThirdPartySkillCard({ skill, onSetup }: ThirdPartySkillCardProps
statusColor={statusDisplay.color}
ctaLabel={ctaLabel()}
ctaVariant={ctaVariant()}
ctaDisabled={isInstalling}
onCtaClick={() => onSetup()}
secondaryActions={secondaryActions}
syncProgress={
Expand Down
7 changes: 3 additions & 4 deletions app/src/pages/Skills.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,9 @@ export default function Skills() {
onChange={setSelectedCategory}
/>

{skillsLoading || installing ? (
{skillsLoading ? (
<div className="py-8 text-center">
<p className="text-sm text-stone-400">
{installing ? `Installing ${installing}...` : 'Loading skills...'}
</p>
<p className="text-sm text-stone-400">Loading skills...</p>
</div>
) : filteredItems.length === 0 ? (
<div className="py-8 text-center">
Expand Down Expand Up @@ -406,6 +404,7 @@ export default function Skills() {
<ThirdPartySkillCard
key={item.id}
skill={item.skill!}
isInstalling={installing === item.id}
onSetup={() => openSkillSetup(item.skill!)}
/>
);
Expand Down
Loading