-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
// SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com>
// SPDX-License-Identifier: AGPL-3.0-only
import type { Meta, StoryObj } from "@storybook/react";
import { withMockedBackend } from "../../.storybook/decorators/withMockedBackend.tsx";
import {
Create,
List,
} from "../mocks/yamori/workspace/v1/key_value_storage_based_workspace_service.ts";
import { WorkspaceSelectionPage } from "./WorkspaceSelectionPage.tsx";
export default {
component: WorkspaceSelectionPage,
parameters: {
layout: "fullscreen",
},
} satisfies Meta<typeof WorkspaceSelectionPage>;
type Story = StoryObj<typeof WorkspaceSelectionPage>;
export const Success: Story = {
decorators: [withMockedBackend([List(), Create()])],
};
export const SlowLoad: Story = {
decorators: [withMockedBackend([List({ delayMs: 2_000 }), Create({ delayMs: 1_000 })])],
};
export const NoWorkspaces: Story = {
decorators: [withMockedBackend([List({ workspaces: [] }), Create()])],
};
export const ListLoadError: Story = {
decorators: [
withMockedBackend([List({ failureRate: 1, delayMs: 200 }), Create({ delayMs: 200 })]),
],
};
export const Flaky: Story = {
decorators: [
withMockedBackend([
List({ failureRate: 0.5, delayMs: 200 }),
Create({ failureRate: 0.5, delayMs: 200 }),
]),
],
};
export const Playground: Story = {};