feat: initialize reactjs project using vite

This commit is contained in:
Melvin Ragusa
2026-01-21 22:38:10 +01:00
parent 95ca6f57e7
commit eccc359782
52 changed files with 9556 additions and 116 deletions

View File

@@ -0,0 +1,42 @@
import { type ReactNode } from 'react';
import { motion } from 'motion/react';
import styles from './Button.module.css';
interface ButtonProps {
variant?: 'primary' | 'secondary' | 'outline';
size?: 'sm' | 'md' | 'lg';
children: ReactNode;
isLoading?: boolean;
disabled?: boolean;
className?: string;
type?: 'button' | 'submit' | 'reset';
onClick?: () => void;
}
export function Button({
variant = 'primary',
size = 'md',
children,
isLoading,
disabled,
className,
type = 'button',
onClick,
}: ButtonProps) {
return (
<motion.button
type={type}
className={`${styles.button} ${styles[variant]} ${styles[size]} ${className || ''}`}
disabled={disabled || isLoading}
whileHover={{ scale: 1.02 }}
whileTap={{ scale: 0.98 }}
onClick={onClick}
>
{isLoading ? (
<span className={styles.loader} />
) : (
children
)}
</motion.button>
);
}