Files
buzz/desktop/src/features/agents/ui/teamImportUpdateState.ts
Taylor Ho 41d343bb35 feat(desktop): team & persona import/edit flows (#288)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 07:17:19 -10:00

34 lines
878 B
TypeScript

import type { TeamImportPlan } from "./teamImportPlan";
export type LineChangeCounts = {
addedLines: number;
removedLines: number;
};
export function hasAnyImportChanges(
plan: TeamImportPlan | null,
teamLineChanges: LineChangeCounts,
): boolean {
return (
teamLineChanges.addedLines > 0 ||
teamLineChanges.removedLines > 0 ||
(plan?.membersToUpdate.length ?? 0) > 0 ||
(plan?.newMembers.length ?? 0) > 0 ||
(plan?.missingMembers.length ?? 0) > 0
);
}
export function getAddMemberSecondaryText(
shouldAdd: boolean,
importedPromptPreview: string,
): string {
return shouldAdd ? importedPromptPreview : "Will not be added to this team";
}
export function getMissingMemberSecondaryText(
shouldRemove: boolean,
currentPromptPreview: string,
): string {
return shouldRemove ? "Will be removed from this team" : currentPromptPreview;
}