2024-01-23 04:37:45 +03:00
|
|
|
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 {
|
2024-05-06 18:57:02 +03:00
|
|
|
iconName?: keyof typeof iconList;
|
2024-01-23 04:37:45 +03:00
|
|
|
label: string;
|
|
|
|
color: Color;
|
2024-02-07 03:05:07 +03:00
|
|
|
onClick?: () => void;
|
2024-05-06 18:57:02 +03:00
|
|
|
disabled?: boolean;
|
2024-01-23 04:37:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
export const TextButton = (props: TextButtonProps): JSX.Element => {
|
|
|
|
return (
|
|
|
|
<div
|
2024-05-06 18:57:02 +03:00
|
|
|
className={`${styles.text_button_wrapper} ${
|
|
|
|
props.disabled ? styles.disabled : ""
|
|
|
|
}`}
|
2024-02-07 03:05:07 +03:00
|
|
|
onClick={props.onClick}
|
2024-01-23 04:37:45 +03:00
|
|
|
>
|
2024-05-06 18:57:02 +03:00
|
|
|
{!!props.iconName && (
|
|
|
|
<Icon name={props.iconName} size="normal" color={props.color} />
|
|
|
|
)}
|
|
|
|
<span className={styles[props.color]}>{props.label}</span>
|
2024-01-23 04:37:45 +03:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default TextButton;
|