quivr/frontend/lib/components/ui/TextButton/TextButton.tsx
Antoine Dewez da3880a685
feat(frontend): add notifications for document uploads (#2549)
# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
2024-05-06 08:57:02 -07:00

33 lines
783 B
TypeScript

import { iconList } from "@/lib/helpers/iconList";
import { Color } from "@/lib/types/Colors";
import styles from "./TextButton.module.scss";
import { Icon } from "../Icon/Icon";
interface TextButtonProps {
iconName?: keyof typeof iconList;
label: string;
color: Color;
onClick?: () => void;
disabled?: boolean;
}
export const TextButton = (props: TextButtonProps): JSX.Element => {
return (
<div
className={`${styles.text_button_wrapper} ${
props.disabled ? styles.disabled : ""
}`}
onClick={props.onClick}
>
{!!props.iconName && (
<Icon name={props.iconName} size="normal" color={props.color} />
)}
<span className={styles[props.color]}>{props.label}</span>
</div>
);
};
export default TextButton;