import { jsx as _jsx } from "react/jsx-runtime";
import { CloudDeploymentProvider } from '../../../../../../packages/core/src/domain/generated/output.js';
import { Button } from '../../ui/button.js';
import { ProviderDropdown } from './provider-dropdown.js';
const ALL_PROVIDERS = [
    {
        id: CloudDeploymentProvider.CloudflarePages,
        displayName: 'Cloudflare Pages',
        enabled: true,
        connected: true,
    },
    {
        id: CloudDeploymentProvider.Vercel,
        displayName: 'Vercel',
        enabled: true,
        connected: false,
    },
    {
        id: CloudDeploymentProvider.Netlify,
        displayName: 'Netlify',
        enabled: true,
        connected: false,
    },
    {
        id: CloudDeploymentProvider.AwsAmplify,
        displayName: 'AWS Amplify',
        enabled: false,
        connected: false,
    },
    {
        id: CloudDeploymentProvider.GcpCloudRun,
        displayName: 'Google Cloud Run',
        enabled: false,
        connected: false,
    },
];
const meta = {
    title: 'ApplicationPage/ProviderDropdown',
    component: ProviderDropdown,
    parameters: { layout: 'centered' },
};
export default meta;
const noopSelect = () => undefined;
const defaultTrigger = _jsx(Button, { variant: "outline", children: "Deploy" });
export const Default = {
    args: {
        trigger: defaultTrigger,
        providers: ALL_PROVIDERS,
        selectedProvider: null,
        onSelectEnabled: noopSelect,
        onSelectDisconnected: noopSelect,
    },
};
export const SelectedCloudflare = {
    args: {
        trigger: defaultTrigger,
        providers: ALL_PROVIDERS,
        selectedProvider: CloudDeploymentProvider.CloudflarePages,
        onSelectEnabled: noopSelect,
        onSelectDisconnected: noopSelect,
    },
};
export const AllDisabled = {
    args: {
        trigger: defaultTrigger,
        providers: ALL_PROVIDERS.map((p) => ({ ...p, enabled: false, connected: false })),
        selectedProvider: null,
        onSelectEnabled: noopSelect,
        onSelectDisconnected: noopSelect,
    },
};
export const NoneConnected = {
    args: {
        trigger: defaultTrigger,
        providers: ALL_PROVIDERS.map((p) => ({ ...p, connected: false })),
        selectedProvider: null,
        onSelectEnabled: noopSelect,
        onSelectDisconnected: noopSelect,
    },
};
export const WithEditTokenAffordance = {
    args: {
        trigger: defaultTrigger,
        providers: ALL_PROVIDERS.map((p) => p.id === CloudDeploymentProvider.CloudflarePages || p.id === CloudDeploymentProvider.Vercel
            ? { ...p, connected: true }
            : p),
        selectedProvider: CloudDeploymentProvider.CloudflarePages,
        onSelectEnabled: noopSelect,
        onSelectDisconnected: noopSelect,
        onEditConnection: noopSelect,
    },
};
