diff --git a/ui-v2/src/components/concurrency/global-concurrency-limit-empty-state.test.tsx b/ui-v2/src/components/concurrency/global-concurrency-limit-empty-state.test.tsx new file mode 100644 index 000000000000..d26184237fc3 --- /dev/null +++ b/ui-v2/src/components/concurrency/global-concurrency-limit-empty-state.test.tsx @@ -0,0 +1,18 @@ +import { render, screen } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import { describe, expect, it, vi } from "vitest"; +import { GlobalConcurrencyLimitEmptyState } from "./global-concurrency-limit-empty-state"; + +describe("GlobalConcurrencyLimitEmptyState", () => { + it("when adding limit, callback gets fired", async () => { + const user = userEvent.setup(); + + const mockFn = vi.fn(); + + render(); + await user.click( + screen.getByRole("button", { name: /Add Concurrency Limit/i }), + ); + expect(mockFn).toHaveBeenCalledOnce(); + }); +}); diff --git a/ui-v2/src/components/concurrency/global-concurrency-limit-empty-state.tsx b/ui-v2/src/components/concurrency/global-concurrency-limit-empty-state.tsx new file mode 100644 index 000000000000..90d6dee1ca9c --- /dev/null +++ b/ui-v2/src/components/concurrency/global-concurrency-limit-empty-state.tsx @@ -0,0 +1,30 @@ +import { Button } from "@/components/ui/button"; +import { DocsLink } from "@/components/ui/docs-link"; +import { + EmptyState, + EmptyStateActions, + EmptyStateDescription, + EmptyStateIcon, + EmptyStateTitle, +} from "@/components/ui/empty-state"; +import { PlusIcon } from "lucide-react"; + +type Props = { + onClick: () => void; +}; +export const GlobalConcurrencyLimitEmptyState = ({ onClick }: Props) => ( + + + Add a concurrency limit + + Global concurrency limits can be applied to flow runs, task runs and any + operation where you want to control concurrency. + + + + + + +);