import { CloudDeploymentProvider, CloudDeploymentStatus, } from '../../../../../../packages/core/src/domain/generated/output.js';
import { DeployButton } from './deploy-button.js';
function makeApi(overrides = {}) {
    return {
        state: {
            provider: CloudDeploymentProvider.CloudflarePages,
            status: CloudDeploymentStatus.NotDeployed,
            url: null,
            error: null,
            deploymentId: null,
            lastDeployedAt: null,
            isWorking: false,
            ...overrides,
        },
        refresh: async () => undefined,
        selectProvider: async () => undefined,
        initiate: async () => undefined,
        connect: async () => undefined,
    };
}
const meta = {
    title: 'ApplicationPage/DeployButton',
    component: DeployButton,
    parameters: { layout: 'centered' },
};
export default meta;
export const NotDeployed = {
    args: { deploy: makeApi() },
};
export const Deploying = {
    args: {
        deploy: makeApi({ status: CloudDeploymentStatus.Deploying, isWorking: true }),
    },
};
export const Deployed = {
    args: {
        deploy: makeApi({
            status: CloudDeploymentStatus.Deployed,
            url: 'https://my-app.pages.dev',
        }),
    },
};
export const Failed = {
    args: {
        deploy: makeApi({
            status: CloudDeploymentStatus.Failed,
            error: 'Cloudflare API returned 403',
        }),
    },
};
export const DisabledWhileAgentRunning = {
    args: { deploy: makeApi(), disabled: true },
};
