< Summary

Information
Class: category-tag.tsx
Assembly: app.components
File(s): /home/runner/work/ClutterStock/ClutterStock/frontend/app/components/category-tag.tsx
Tag: 58_25416222083
Line coverage
70%
Covered lines: 7
Uncovered lines: 3
Coverable lines: 10
Total lines: 30
Line coverage: 70%
Branch coverage
50%
Covered branches: 4
Total branches: 8
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

Method
CategoryTag()

File(s)

/home/runner/work/ClutterStock/ClutterStock/frontend/app/components/category-tag.tsx

#LineLine coverage
 1import { useTheme } from "~/lib/theme";
 2import { CATEGORY_COLORS } from "~/lib/colors";
 3
 14export function CategoryTag({ name }: { name: string }) {
 15  const theme = useTheme();
 16  if (theme === "tui") {
 07    return (
 8      <span style={{
 9        fontSize: 11, padding: "1px 6px",
 10        border: "1px solid #ffd24d", color: "#ffd24d",
 11        fontFamily: "inherit", whiteSpace: "nowrap",
 12      }}>[{name}]</span>
 13    );
 14  }
 115  if (theme === "win98") {
 016    return <span style={{ fontSize: 11, color: "var(--c-fg)" }}>{name}</span>;
 17  }
 118  if (theme === "cde") {
 019    return <span style={{ fontSize: 11, color: "#3d6062", fontWeight: 700 }}>{name}</span>;
 20  }
 121  const c = CATEGORY_COLORS[name] ?? { bg: "rgba(120,120,140,0.10)", fg: "var(--c-fg-2)" };
 122  return (
 23    <span style={{
 24      fontSize: 11, padding: "2px 8px", borderRadius: 4,
 25      background: c.bg, color: c.fg, fontWeight: 500, whiteSpace: "nowrap",
 26    }}>
 27      {name}
 28    </span>
 29  );
 30}

Methods/Properties

CategoryTag()V