40 lines
1.3 KiB
TypeScript
40 lines
1.3 KiB
TypeScript
"use client";
|
|
|
|
import React, { CSSProperties, MouseEventHandler } from 'react';
|
|
import styles from "@/css/OldButton.module.css";
|
|
import clsx from 'clsx';
|
|
|
|
interface OldButtonProps {
|
|
children?: string;
|
|
long?: boolean;
|
|
red?: boolean;
|
|
disabled?: boolean;
|
|
className?: string;
|
|
style?: CSSProperties;
|
|
onAction?: MouseEventHandler<HTMLButtonElement>;
|
|
};
|
|
|
|
export default function OldButton({children, long=true, red=true, disabled=false, className, style, onAction}: OldButtonProps) {
|
|
return (
|
|
<button
|
|
className={clsx(styles["button"], disabled && styles["button-disabled"], className)}
|
|
style={style}
|
|
onClick={(disabled ? undefined : onAction)}
|
|
disabled={disabled}
|
|
>
|
|
<img
|
|
src={
|
|
red ?
|
|
long ? "/buttons/Button_rot_lang.webp" : "/buttons/Button_rot_kurz.webp"
|
|
:
|
|
long ? "/buttons/Button_blau_lang.webp" : "/buttons/Button_blau_kurz.webp"
|
|
}
|
|
alt={"Button Background"}
|
|
className={styles["image"]}
|
|
/>
|
|
<span className={clsx(styles["label"], "lancelot-regular", disabled && styles["label-disabled"])}>
|
|
{children}
|
|
</span>
|
|
</button>
|
|
);
|
|
} |