-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ErrorCard created #46
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
import { fn } from '@storybook/test'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Checar si la dependencia |
||
import ErrorCard from './ErrorCard'; | ||
|
||
const meta = { | ||
title: 'Components/ErrorCard', | ||
component: ErrorCard, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
argTypes: { | ||
title: { | ||
control: 'text', | ||
} | ||
}, | ||
tags: ["autodocs"] | ||
}satisfies Meta<typeof ErrorCard>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Primary: Story = { | ||
args: { | ||
title: 'Error fetching training data', | ||
}, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from "react"; | ||
import { IErrorCard } from "./types"; | ||
|
||
/** | ||
* An error card that displays the error message | ||
*/ | ||
|
||
const ErrorCard: React.FC<IErrorCard> = ({ title }) => { | ||
return ( | ||
<div className="bg-white text-aci-red text-left px-5 py-1 rounded-xl shadow-lg text-text font-bold"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agregar |
||
{title} | ||
</div> | ||
); | ||
}; | ||
|
||
export default ErrorCard; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as ErrorCard} from './ErrorCard'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export interface IErrorCard{ | ||
/** | ||
* The text prop of the ErrorCard | ||
*/ | ||
title: string; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reestructura todo el archivo basándote en
components/Button/Button.stories.tsx
, ya que faltan muchas etiquetas como parameters, argTypes y tags