mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
This hooks up `storybook`, which the front-end team has enjoyed using in the v1 codebase - it makes it quick and easy to view and test components in isolation. The `<LoadingButton />` has a simple story added now, so if you run `yarn storybook`, you can preview it in various states:  This will be helpful as we bring more front-end devs to help build v2 out.
27 lines
645 B
TypeScript
27 lines
645 B
TypeScript
import { Story } from "@storybook/react"
|
|
import React from "react"
|
|
import { LoadingButton, LoadingButtonProps } from "./LoadingButton"
|
|
|
|
export default {
|
|
title: "Button/LoadingButton",
|
|
component: LoadingButton,
|
|
argTypes: {
|
|
loading: { control: { type: "boolean" } },
|
|
children: { control: "text", defaultValue: "Create workspace" },
|
|
},
|
|
}
|
|
|
|
const Template: Story<LoadingButtonProps> = (args) => <LoadingButton {...args} />
|
|
|
|
export const Loading = Template.bind({})
|
|
Loading.args = {
|
|
variant: "contained",
|
|
loading: true,
|
|
}
|
|
|
|
export const NotLoading = Template.bind({})
|
|
NotLoading.args = {
|
|
variant: "contained",
|
|
loading: false,
|
|
}
|