Skip to content

Commit

Permalink
Docs: Story for the EntryStatus component #646
Browse files Browse the repository at this point in the history
Docs: Add Alert Story (#646) Wrote a Story for the EntryStatus component Closes #646
  • Loading branch information
Larocca authored and Larocca committed Nov 15, 2024
1 parent 9a23398 commit 6afb0b5
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions components/EntryStatus/EntryStatus.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import type { Meta, StoryObj } from '@storybook/react';
import { EntryStatus } from './EntryStatus';

const meta: Meta<typeof EntryStatus> = {
title: 'Components/EntryStatus',
component: EntryStatus,
tags: ['autodocs'],
parameters: {
docs: {
description: {
component: `
The \`EntryStatus\` component is a UI element designed to inform users about the status of their LeagueEntry, indicating whether it is currently "alive" or "eliminated". It uses a simple visual cue with text and background color to convey the status.
### Usage
The \`EntryStatus\` component is used to provide users with a clear indication of their entry status in a league. It displays a rounded badge with text indicating the current status.
\`\`\`jsx
<EntryStatus isEliminated={false} />
\`\`\`
### Props
- **isEliminated**: A boolean prop that determines the status of the entry. If \`true\`, the entry is marked as "eliminated" with a corresponding background color. If \`false\`, it is marked as "alive".
### Styling
The component uses utility classes to style the badge, changing the background color based on the \`isEliminated\` prop. The text is styled to be uppercase and small for a concise display.
`,
},
},
},
argTypes: {
isEliminated: {
control: { type: 'boolean' },
description: 'Determines if the entry is marked as eliminated.',
},
},
args: {
isEliminated: false,
},
} satisfies Meta<typeof EntryStatus>;

export default meta;

type Story = StoryObj<typeof meta>;

export const Alive: Story = {
args: {
isEliminated: false,
},
};

export const Eliminated: Story = {
args: {
isEliminated: true,
},
};

0 comments on commit 6afb0b5

Please sign in to comment.