MCPcopy Create free account
hub / github.com/api-platform/website / Button

Function Button

pwa/components/con/common/Button.tsx:17–54  ·  view source on GitHub ↗
({
  children,
  className,
  empty,
  square,
  disabled,
  to,
  size = "large",
  external = false,
  ...props
}: ButtonProps)

Source from the content-addressed store, hash-verified

15}
16
17export default function Button({
18 children,
19 className,
20 empty,
21 square,
22 disabled,
23 to,
24 size = "large",
25 external = false,
26 ...props
27}: ButtonProps) {
28 const classNames = classnames(
29 "btn cursor-pointer font-title",
30 { small: "small" === size, empty, square, disabled },
31 className
32 );
33 const externalProps = { target: "_blank", rel: "noopener noreferrer" };
34
35 return to ? (
36 external ? (
37 <a className={classNames} href={to} {...(external ? externalProps : {})}>
38 {children}
39 </a>
40 ) : (
41 <Link
42 className={classNames}
43 href={to}
44 {...(external ? externalProps : {})}
45 >
46 {children}
47 </Link>
48 )
49 ) : (
50 <div className={classNames} {...props}>
51 {children}
52 </div>
53 );
54}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected