'use client';

import type { TaskCategory } from '@/lib/task-category';

export function CategoryChip({ category }: { category?: TaskCategory }) {
  if (!category) return <span className="text-[11px] text-[var(--ink-muted)]">未分类</span>;
  return (
    <span
      className="inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium"
      style={{
        backgroundColor: category.color ? `${category.color}15` : 'var(--bg-subtle)',
        color: category.color || 'var(--ink-soft)',
      }}
    >
      {category.name}
    </span>
  );
}
