"use client"; import { useEffect, useState } from "react"; import { Input } from "@kandev/ui/input"; import { Label } from "@kandev/ui/label"; type GitHubPushConfigProps = { config: Record; onUpdate: (config: Record) => void; }; export function GitHubPushConfig({ config, onUpdate }: GitHubPushConfigProps) { const configBranches = ((config.branches as string[]) ?? []).join(", "); const [branches, setBranches] = useState(configBranches); useEffect(() => { setBranches(configBranches); }, [configBranches]); const handleBlur = () => { const parsed = branches .split(",") .map((b) => b.trim()) .filter(Boolean); onUpdate({ ...config, branches: parsed }); }; return (
setBranches(e.target.value)} onBlur={handleBlur} placeholder="main, release/*" />

Triggers when code is pushed to matching branches

); }