import React from 'react';
import { cn } from '../../utils/cn';
import { SlackIcon } from '../icons/slack-icon';
export interface SlackChannelChipProps {
/** Channel display name, no '#' prefix. Falls back to plain "Slack" when null. */
name?: string | null;
/** Web deep link to the channel (e.g. https://app.slack.com/client/T…/C…). Renders unlinked when null. */
href?: string | null;
/** Extra classes merged onto the chip span. */
className?: string;
}
/**
* Inline Slack-channel reference: the Slack icon + "#name", optionally linked
* to the channel's web deep link. Server-component safe (no hooks/state).
* Degrades gracefully: no name renders plain "Slack", no href renders unlinked.
*/
export function SlackChannelChip({ name, href, className }: SlackChannelChipProps) {
const inner = (
{name ? `#${name}` : 'Slack'}
);
if (!href) return inner;
return (
{inner}
);
}