26 lines
457 B
TypeScript
26 lines
457 B
TypeScript
import React from 'react';
|
|
|
|
export interface ButtonProps {
|
|
text?: string;
|
|
onClick?: () => void;
|
|
variant?: 'primary' | 'secondary' | 'outline';
|
|
disabled?: boolean;
|
|
}
|
|
|
|
export const Button: React.FC<ButtonProps> = ({
|
|
text = 'Button',
|
|
onClick,
|
|
variant = 'primary',
|
|
disabled = false,
|
|
}) => {
|
|
return (
|
|
<button
|
|
className={`btn btn-${variant}`}
|
|
onClick={onClick}
|
|
disabled={disabled}
|
|
>
|
|
{text}
|
|
</button>
|
|
);
|
|
};
|
|
|