// — the fields of one review classification: a name, a // description (the prompt the model answers), which answer passes, and how // certain the model has to be for its answer to count. import { Button } from "../../ui/button/Button.js"; import { SelectField } from "../../ui/select-field/SelectField.js"; import { TextAreaField } from "../../ui/text-area-field/TextAreaField.js"; import { TextField } from "../../ui/text-field/TextField.js"; import type { ClassificationDraft, Polarity } from "./TryOutTypes.js"; import "./ReviewTryOutPage.css"; const POLARITY_OPTIONS = [ { value: "positive", label: "positive — the PR should match" }, { value: "negative", label: "negative — the PR should not match" }, ]; export function ClassificationEditor({ draft, onChange, onRemove, }: { draft: ClassificationDraft; onChange: (next: ClassificationDraft) => void; /** Absent when this is the only classification: one is the minimum. */ onRemove?: () => void; }) { const id = `tryout-${draft.key}`; return (
onChange({ ...draft, name })} /> onChange({ ...draft, description })} />
onChange({ ...draft, polarity: polarity as Polarity }) } /> onChange({ ...draft, threshold })} /> {onRemove ? : null}
); }