Files
paseo/packages/website/src/plugins/plugin-tile.tsx
T
Mohamed Boudra bdc58fb07c feat(website): plugins hero, author and description on cards, install counts with an icon
The plugins page opens with the directory copy, plugin and author counts,
Submit a plugin and Read the docs, and search. Featured and What's new cards
show the description and the author with avatar; the trailing slot carries
installs on Featured and the added date on What's new. Every install count
on the site is the same download icon and number.
2026-10-06 23:18:20 +02:00

25 lines
838 B
TypeScript

import { pluginOverviewUrl } from "@getpaseo/protocol/plugin-overview";
import type { Plugin } from "./registry";
const SIZE_CLASS = {
xs: "h-6 w-6 rounded-md text-xs",
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>
);
}