import type { StatusCardRefreshPolicy } from "@paperclipai/shared"; import { ChevronDown } from "lucide-react"; import { Checkbox } from "@/components/ui/checkbox"; import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible"; import { Input } from "@/components/ui/input"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"; import { cn } from "@/lib/utils"; import { estimateStatusCardCost } from "./format"; export interface StatusCardSettingsValue { refreshPolicy: StatusCardRefreshPolicy; } export function defaultSettingsValue(): StatusCardSettingsValue { return { refreshPolicy: { mode: "manual", triggers: { statusTransitions: true, membershipChanges: true, humanComments: true, assigneeChanges: true, anyUpdate: false, }, }, }; } const INTERVAL_OPTIONS = [5, 15, 30, 60]; const DEBOUNCE_OPTIONS = [30, 60, 120, 300]; type TriggerKey = keyof StatusCardRefreshPolicy["triggers"]; const TRIGGER_ROWS: { key: TriggerKey; label: string; noisy?: boolean }[] = [ { key: "statusTransitions", label: "Became blocked / needs review / done / cancelled" }, { key: "membershipChanges", label: "New issue matches the query · issue leaves the query" }, { key: "humanComments", label: "Human comments" }, { key: "assigneeChanges", label: "Assignee changes" }, { key: "anyUpdate", label: "Any update at all (noisy — includes in-progress churn)", noisy: true }, ]; function RadioRow({ selected, title, badge, onSelect, children, }: { selected: boolean; title: string; badge?: React.ReactNode; onSelect: () => void; children?: React.ReactNode; }) { return (
{costEstimate.primary}
{costEstimate.note ?{costEstimate.note}
: null}Rough estimate from typical update sizes; actual cost is tracked per update.