fix: renamed button related files

This commit is contained in:
Maximilian Liebmann 2025-04-19 22:14:56 +02:00 committed by Dominik
parent 5a6c03a041
commit 6b14e093e7
2 changed files with 93 additions and 0 deletions

39
src/components/button.tsx Normal file
View file

@ -0,0 +1,39 @@
import style from './button.module.css';
import { IconProp } from '@fortawesome/fontawesome-svg-core';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
export default function Button({
type,
children,
mode = 'primary',
icon,
}: {
type?: 'button' | 'submit' | 'reset';
children?: React.ReactNode;
mode?: 'primary' | 'warning' | 'success' | 'danger';
icon?: IconProp;
}) {
if (!icon) {
return (
<button
className={style.button + ' ' + style['style_' + mode]}
type={type}
>
<span>{children}</span>
</button>
);
} else {
return (
<button
className={
style.button + ' ' + style['style_' + mode] + ' ' + style['icon']
}
type={type}
>
<FontAwesomeIcon icon={icon} height={25} />
<span>{children}</span>
</button>
);
}
}