- Notifications
You must be signed in to change notification settings - Fork1k
refactor: replace badge by status indicator#17811
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import type { Workspace, WorkspaceStatus } from "api/typesGenerated"; | ||
import { MockWorkspace } from "testHelpers/entities"; | ||
import { WorkspaceStatusIndicator } from "./WorkspaceStatusIndicator"; | ||
const meta: Meta<typeof WorkspaceStatusIndicator> = { | ||
title: "modules/workspaces/WorkspaceStatusIndicator", | ||
component: WorkspaceStatusIndicator, | ||
}; | ||
export default meta; | ||
type Story = StoryObj<typeof WorkspaceStatusIndicator>; | ||
const createWorkspaceWithStatus = (status: WorkspaceStatus): Workspace => { | ||
return { | ||
...MockWorkspace, | ||
latest_build: { | ||
...MockWorkspace.latest_build, | ||
status, | ||
}, | ||
} as Workspace; | ||
}; | ||
export const Running: Story = { | ||
args: { | ||
workspace: createWorkspaceWithStatus("running"), | ||
}, | ||
}; | ||
export const Stopped: Story = { | ||
args: { | ||
workspace: createWorkspaceWithStatus("stopped"), | ||
}, | ||
}; | ||
export const Starting: Story = { | ||
args: { | ||
workspace: createWorkspaceWithStatus("starting"), | ||
}, | ||
}; | ||
export const Stopping: Story = { | ||
args: { | ||
workspace: createWorkspaceWithStatus("stopping"), | ||
}, | ||
}; | ||
export const Failed: Story = { | ||
args: { | ||
workspace: createWorkspaceWithStatus("failed"), | ||
}, | ||
}; | ||
export const Canceling: Story = { | ||
args: { | ||
workspace: createWorkspaceWithStatus("canceling"), | ||
}, | ||
}; | ||
export const Canceled: Story = { | ||
args: { | ||
workspace: createWorkspaceWithStatus("canceled"), | ||
}, | ||
}; | ||
export const Deleting: Story = { | ||
args: { | ||
workspace: createWorkspaceWithStatus("deleting"), | ||
}, | ||
}; | ||
export const Deleted: Story = { | ||
args: { | ||
workspace: createWorkspaceWithStatus("deleted"), | ||
}, | ||
}; | ||
export const Pending: Story = { | ||
args: { | ||
workspace: createWorkspaceWithStatus("pending"), | ||
}, | ||
}; |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.