MCPcopy Create free account
hub / github.com/ScrapeGraphAI/scrapecraft / Button

Function Button

frontend/src/components/Common/Button.tsx:10–46  ·  view source on GitHub ↗
({
  variant = 'primary',
  size = 'md',
  children,
  className,
  disabled,
  ...props
})

Source from the content-addressed store, hash-verified

8}
9
10const Button: React.FC<ButtonProps> = ({
11 variant = 'primary',
12 size = 'md',
13 children,
14 className,
15 disabled,
16 ...props
17}) => {
18 const baseClasses = 'font-medium rounded-md transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-background disabled:opacity-50 disabled:cursor-not-allowed';
19
20 const variantClasses = {
21 primary: 'bg-primary text-white hover:bg-primary/90 focus:ring-primary',
22 secondary: 'bg-secondary text-foreground hover:bg-secondary/80 focus:ring-secondary',
23 destructive: 'bg-destructive text-white hover:bg-destructive/90 focus:ring-destructive'
24 };
25
26 const sizeClasses = {
27 sm: 'px-3 py-1.5 text-sm',
28 md: 'px-4 py-2 text-base',
29 lg: 'px-6 py-3 text-lg'
30 };
31
32 return (
33 <button
34 className={clsx(
35 baseClasses,
36 variantClasses[variant],
37 sizeClasses[size],
38 className
39 )}
40 disabled={disabled}
41 {...props}
42 >
43 {children}
44 </button>
45 );
46};
47
48export default Button;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected