Skip to content

Commit

Permalink
chore: add reaction buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Fidesnoella committed Jan 13, 2025
1 parent a14a493 commit 8ef12a0
Show file tree
Hide file tree
Showing 6 changed files with 735 additions and 49 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { Meta, StoryObj } from "@storybook/react";
import { ReactionType } from "src/feedback/reaction/reaction.types";
import ReactionButtons from "src/feedback/reaction//components/reactionButtons/ReactionButtons";

const meta: Meta<typeof ReactionButtons> = {
title: "feedback/Reaction/ReactionButtons",
component: ReactionButtons,
tags: ["autodocs"],
args: {
sessionId: "1234",
messageId: "001",
},
};

export default meta;

type Story = StoryObj<typeof ReactionButtons>;

const mockData = (status: number, delay: number = 0) => [
{
url: "/conversation/1234/messages/001/reaction",
method: "PUT",
status: status,
response: {},
delay: delay,
},
];

export const Shown: Story = {
args: {},
parameters: {
mockData: mockData(200),
},
};

export const ShownWithLikeReaction: Story = {
args: {
currentReaction: ReactionType.LIKE,
},
parameters: {
mockData: mockData(200),
},
};

export const ShownWithDislikeReaction: Story = {
args: {
currentReaction: ReactionType.DISLIKE,
},
parameters: {
mockData: mockData(200),
},
};

export const FailingReactionSubmission: Story = {
args: {},
parameters: {
mockData: mockData(500, 1000),
},
};
Loading

0 comments on commit 8ef12a0

Please sign in to comment.