plazbot
Version:
Official Plazbot SDK for creating AI agents for WhatsApp, portals, and developers.
26 lines (25 loc) • 1.68 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { usePlazbotContext } from '../../context/PlazbotContext';
import { resolveIcon } from '../../styles/icons';
export function SourceCard({ source, style }) {
const { theme, iconMode } = usePlazbotContext();
return (_jsxs("div", { style: {
display: 'flex',
gap: '10px',
padding: '10px 14px',
borderRadius: theme.borderRadius,
backgroundColor: theme.surfaceColor,
border: `1px solid ${theme.borderColor}`,
fontSize: theme.fontSizeSm,
fontFamily: theme.fontFamily,
animation: 'plazbot-fade-in 0.2s ease-out',
...style,
}, children: [resolveIcon('source', iconMode) && _jsx("span", { style: { fontSize: '16px', flexShrink: 0, marginTop: '1px' }, children: resolveIcon('source', iconMode) }), _jsxs("div", { style: { minWidth: 0, flex: 1 }, children: [source.title && (_jsx("div", { style: { fontWeight: 500, color: theme.textColor, marginBottom: '2px' }, children: source.url ? (_jsx("a", { href: source.url, target: "_blank", rel: "noopener noreferrer", style: { color: theme.primaryColor, textDecoration: 'none' }, children: source.title })) : (source.title) })), source.content && (_jsx("div", { style: {
color: theme.textSecondary,
overflow: 'hidden',
display: '-webkit-box',
WebkitLineClamp: 2,
WebkitBoxOrient: 'vertical',
lineHeight: 1.4,
}, children: source.content }))] })] }));
}