import { Button } from "../../../ui/button"; import type { CapabilityCatalogItem } from "../../types"; /** The add-in's name and install page, as the API projected them onto its tile. */ export function excelAddinDetails(item: Pick): { name: string; installUrl: string | null; } { const { addinName, installUrl } = item.metadata; return { name: typeof addinName === "string" && addinName ? addinName : "Opengeni", installUrl: typeof installUrl === "string" && installUrl ? installUrl : null, }; } /** Opens the add-in's install-and-connect page; the add-in lives in each person's own Excel. */ export function ExcelAddinCatalogLink({ item, preserveChat = false, }: { item: Pick; preserveChat?: boolean | undefined; }) { const { installUrl } = excelAddinDetails(item); if (!installUrl) return null; return ( ); } /** What the add-in does and the three steps to start using it. */ export function ExcelAddinSetupSteps({ item, preserveChat = false, }: { item: Pick; preserveChat?: boolean | undefined; }) { const { name, installUrl } = excelAddinDetails(item); if (!installUrl) { return (

The Excel add-in is not set up on this deployment yet.

); } return (
  1. Add {name} to Excel{preserveChat ? " (opens in a new tab)" : ""}. It works in Excel on the web, Windows and Mac.
  2. Open a workbook and choose Home > Add-ins > {name}, then sign in.
  3. Chat in the pane, or ask an agent in any chat to work in that workbook.
); }