Files
paseo/packages/website/src/plugins/plugin-tile.tsx
T
Mohamed Boudra fc3b2c4eb7 Sanitize plugin overview rendering: no raw HTML, https links only, no relative links (#6244)
* fix(plugins): restrict overview content to safe Markdown and HTTPS destinations

Registry overviews are author-controlled content read away from their repositories. Apply a shared presentation policy instead of the documentation renderer so relative links, non-HTTPS URLs, raw HTML, and author styles never become active overview content.

* fix(plugins): choose the first allowed screenshot for previews
2026-10-06 18:31:53 +01:00

24 lines
802 B
TypeScript

import { pluginOverviewUrl } from "@getpaseo/protocol/plugin-overview";
import type { Plugin } from "./registry";
const SIZE_CLASS = {
sm: "h-9 w-9 rounded-lg text-sm",
lg: "h-14 w-14 rounded-xl text-xl",
} as const;
/** PNG icon with a letter tile when no icon is published. */
export function PluginTile({ plugin, size }: { plugin: Plugin; size: keyof typeof SIZE_CLASS }) {
return (
<div
aria-hidden
className={`flex flex-shrink-0 items-center justify-center border border-white/10 bg-white/[0.06] font-medium text-white/80 ${SIZE_CLASS[size]}`}
>
{pluginOverviewUrl(plugin.icon) ? (
<img src={plugin.icon} alt="" className="h-full w-full rounded-[inherit] object-cover" />
) : (
plugin.name.charAt(0).toUpperCase()
)}
</div>
);
}