mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
- Remove all lite/full variant logic from frontend, API, shared constants, docs, and tests (single unified Docker image only) - Replace single QEMU multi-arch Docker build with per-architecture native builds (amd64 + arm64) and manifest merge to fix disk space exhaustion - Add disk cleanup step and per-platform build cache scopes - Switch release trigger from push to workflow_dispatch - Add GitHub issue templates and PR template
43 lines
1.4 KiB
TypeScript
43 lines
1.4 KiB
TypeScript
import type { Tool } from "@stirling-image/shared";
|
|
import * as icons from "lucide-react";
|
|
import { FileImage, Star } from "lucide-react";
|
|
import { Link } from "react-router-dom";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
interface ToolCardProps {
|
|
tool: Tool;
|
|
}
|
|
|
|
export function ToolCard({ tool }: ToolCardProps) {
|
|
const iconsMap = icons as unknown as Record<string, React.ComponentType<{ className?: string }>>;
|
|
const IconComponent = iconsMap[tool.icon] || FileImage;
|
|
|
|
return (
|
|
<div className="group flex items-center gap-3 relative">
|
|
<button
|
|
type="button"
|
|
className="opacity-0 group-hover:opacity-100 transition-opacity absolute -left-5"
|
|
title="Add to favourites"
|
|
>
|
|
<Star className="h-3 w-3 text-muted-foreground hover:text-yellow-500" />
|
|
</button>
|
|
<Link
|
|
to={tool.route}
|
|
className={cn(
|
|
"flex items-center gap-3 py-2 px-3 rounded-lg w-full transition-colors",
|
|
"hover:bg-muted",
|
|
tool.disabled && "opacity-50 pointer-events-none",
|
|
)}
|
|
>
|
|
<IconComponent className="h-5 w-5 text-muted-foreground" />
|
|
<span className="text-sm font-medium text-foreground">{tool.name}</span>
|
|
{tool.experimental && (
|
|
<span className="text-[10px] px-1.5 py-0.5 rounded bg-orange-100 text-orange-600 font-medium">
|
|
Experimental
|
|
</span>
|
|
)}
|
|
</Link>
|
|
</div>
|
|
);
|
|
}
|