Skip to content

Commit

Permalink
Add <Helper />
Browse files Browse the repository at this point in the history
  • Loading branch information
gskril committed May 16, 2024
1 parent 51d7d27 commit 4492d16
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions app/src/components/Helper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import clsx from 'clsx';
import { FC } from 'react';

type HelperType = 'info' | 'warning' | 'error';

export const Helper: FC<{ children: string; type: HelperType }> = ({
children,
type,
}) => {
const colors = {
info: 'blue',
warning: 'yellow',
error: 'red',
};

const color = colors[type] || 'blue';
const classes = `border-ens-light-${color}-bright bg-ens-light-${color}-surface dark:border-ens-dark-${color}-bright dark:bg-ens-dark-${color}-surface`;

return (
<div>
<div
className={clsx([classes, 'not-prose rounded-md border p-6'])}
>
<p>{children}</p>
</div>
</div>
);
};

0 comments on commit 4492d16

Please sign in to comment.