mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-08 12:20:58 +00:00
404e3466d9
* feat(cloud): add scoped support admin sessions * style(web): format support admin session changes * fix(cloud): isolate support adapter sessions * fix(cloud): authenticate plugin assets and report workspace resources --------- Co-authored-by: dadachann <185672915+dadachann@users.noreply.github.com>
33 lines
675 B
TypeScript
33 lines
675 B
TypeScript
import { useAuthenticatedPluginIcon } from '@/hooks/useAuthenticatedPluginResource';
|
|
import { cn } from '@/lib/utils';
|
|
|
|
export function AuthenticatedPluginIcon({
|
|
author,
|
|
name,
|
|
alt = '',
|
|
className,
|
|
}: {
|
|
author: string;
|
|
name: string;
|
|
alt?: string;
|
|
className?: string;
|
|
}) {
|
|
const icon = useAuthenticatedPluginIcon(
|
|
author,
|
|
name,
|
|
Boolean(author && name),
|
|
);
|
|
|
|
if (!icon.url || icon.error) {
|
|
return (
|
|
<span
|
|
aria-hidden={alt ? undefined : true}
|
|
aria-label={alt || undefined}
|
|
className={cn('inline-block bg-muted', className)}
|
|
/>
|
|
);
|
|
}
|
|
|
|
return <img src={icon.url} alt={alt} className={className} />;
|
|
}
|