"use client";
import { IconArrowUpCircle } from "@tabler/icons-react";
import { Badge } from "@kandev/ui/badge";
import { Button } from "@kandev/ui/button";
import Link from "@/components/routing/app-link";
import { PluginRepoLink } from "./plugin-repo-link";
import { PluginStatusBadge } from "./plugin-status-badge";
import type { MarketplaceEntry, PluginRecord } from "@/lib/types/plugins";
type PluginRowProps = {
plugin: PluginRecord;
busy: boolean;
/** Set when the marketplace has a newer version than the installed one. */
update?: MarketplaceEntry;
onEnable: (plugin: PluginRecord) => void;
onDisable: (plugin: PluginRecord) => void;
onUninstall: (plugin: PluginRecord) => void;
onUpdate?: (entry: MarketplaceEntry) => void;
};
/**
* One plugin's row. Div-based (not a `
`) so it wraps/stacks naturally
* on narrow viewports and inside the mobile settings sheet — no separate
* mobile layout needed.
*/
export function PluginRow({
plugin,
busy,
update,
onEnable,
onDisable,
onUninstall,
onUpdate,
}: PluginRowProps) {
const canEnable = plugin.status === "disabled" || plugin.status === "registered";
const canDisable = plugin.status === "active" || plugin.status === "error";
return (