Skip to content

⭐️⭐️⭐️ Open-source, self-hosted alternative to Linear and Plane. Project management and issue tracking where teams and AI agents work side by side to plan and ship products.

1.1 KB
Raw Blame
import type { CustomField } from '@/lib/api/endpoints/customFields';
import type { Assignee } from '@/lib/api/endpoints/projects';
import type { IssueFieldValueInput } from '@/lib/api/endpoints/issues';
import IssueCustomFieldPill from '../fields/IssueCustomFieldPill';

// The body fields that are not markdown, gathered in the "Other" section: a pill
// each is too small to be worth a section of its own.
export default function NewIssueBodyFields({
  defs,
  values,
  assignees,
  onChange,
}: {
  defs: CustomField[];
  values: Record<number, IssueFieldValueInput>;
  assignees: Assignee[];
  onChange: (id: number, patch: IssueFieldValueInput) => void;
}) {
  return (
    <div className="space-y-4">
      {defs.map((def) => (
        <div key={def.id}>
          <h3 className="mb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase">
            {def.name}
          </h3>
          <IssueCustomFieldPill
            def={def}
            value={values[def.id]}
            assignees={assignees}
            onChange={(v) => onChange(def.id, v)}
          />
        </div>
      ))}
    </div>
  );
}