'use client' import * as React from 'react' import { cn } from '../../utils/cn' import { ExternalLinkIcon } from '../icons-v2-generated' import { Button } from '../ui/button' import { SquareAvatar } from '../ui/square-avatar' export interface MspOrganizationCardProps { /** MSP/organization name. Woven into the default title: "Your IT is managed by {name}". */ name: string /** Organization website shown beneath the title (e.g. "www.techflow.com"). */ website?: string /** Organization logo URL. Falls back to initials derived from `name` when absent. */ logoUrl?: string /** Full title override. Defaults to `Your IT is managed by {name}`. */ title?: React.ReactNode /** * Website link. When set, the trailing action renders as an anchor * (``). Takes precedence over `onOpenWebsite`. */ href?: string /** Click handler for the trailing action (used when `href` is not set). */ onOpenWebsite?: () => void /** Appended to the root element. */ className?: string } /** * MSP Organization card for the AI Assistant welcome screen. * * A horizontal card — square org logo, "Your IT is managed by {name}" title with * the website beneath, and a trailing external-link button — so users can confirm * which organization they are signing into. Mirrors Figma `openframe — fae-chat` * (node 1:5540) using ODS tokens. * * The trailing button renders only when `href` or `onOpenWebsite` is provided: * `href` becomes an anchor (new tab), otherwise `onOpenWebsite` fires on click. */ export function MspOrganizationCard({ name, website, logoUrl, title, href, onOpenWebsite, className, }: MspOrganizationCardProps) { const actionLabel = website ? `Open ${website}` : 'Open organization website' return (
{title ?? `Your IT is managed by ${name}`} {website ? {website} : null}
{href ? (
) : onOpenWebsite ? ( ) : null}
) }