"use client"; import { useActionState } from "react"; import { Popover, Select } from "@unlocalhosted/metalui"; import type { FormState } from "@/app/actions/types"; import { BranchIcon, ChevronDownIcon, PlayIcon } from "@/components/icons"; import { Alert, Button } from "@/components/ui"; /** "Run workflow": a popover choosing the branch to run a `workflow_dispatch` workflow on. */ export function DispatchButton({ action, branches, defaultBranch, }: { action: (prev: FormState, formData: FormData) => Promise; branches: string[]; defaultBranch: string; }) { const [state, formAction, pending] = useActionState(action, undefined); return ( Run this workflow