Skip to content

Commit

Permalink
Add dev-story for FeedbackButton (#2931)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesricky authored Dec 16, 2024
1 parent 4141eef commit 3792ee1
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions storybook/src/admin/FeedbackButton.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { FeedbackButton } from "@comet/admin";
import { Add } from "@comet/admin-icons";
import { Card, CardContent, Stack } from "@mui/material";

export default {
title: "@comet/admin/FeedbackButton",
};

export const Default = {
render: () => (
<Card>
<CardContent>
<Stack direction="row" spacing={2}>
<FeedbackButton
startIcon={<Add />}
onClick={() => {
return new Promise((resolve) => setTimeout(resolve, 500));
}}
>
This will succeed
</FeedbackButton>
<FeedbackButton
startIcon={<Add />}
onClick={() => {
return new Promise((_, reject) => setTimeout(reject, 500));
}}
>
This will fail
</FeedbackButton>
<FeedbackButton
startIcon={<Add />}
onClick={() => {
return new Promise((resolve) => setTimeout(resolve, 500));
}}
tooltipErrorMessage="This failed but at least it has a custom message"
tooltipSuccessMessage="This worked and has a custom message"
>
Custom message (succeeds)
</FeedbackButton>
<FeedbackButton
startIcon={<Add />}
onClick={() => {
return new Promise((_, reject) => setTimeout(reject, 500));
}}
tooltipErrorMessage="This failed but at least it has a custom message"
tooltipSuccessMessage="This worked and has a custom message"
>
Custom message (fails)
</FeedbackButton>
</Stack>
</CardContent>
</Card>
),
};

0 comments on commit 3792ee1

Please sign in to comment.