mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-30 10:19:51 -06:00
Move repository into a monorepo with turborepo and pnpm. This is a big change in the way the code is organized, used and deployed.
45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
import React from "react";
|
|
import { classNames } from "../lib/utils";
|
|
|
|
interface Props {
|
|
children: React.ReactNode;
|
|
onClick?: () => void;
|
|
disabled?: boolean;
|
|
fullwidth?: boolean;
|
|
small?: boolean;
|
|
icon?: boolean;
|
|
secondary?: boolean;
|
|
[key: string]: any;
|
|
}
|
|
|
|
// button component, consuming props
|
|
const StandardButton: React.FC<Props> = ({
|
|
children,
|
|
onClick = () => {},
|
|
disabled = false,
|
|
fullwidth = false,
|
|
small = false,
|
|
icon = false,
|
|
secondary = false,
|
|
...rest
|
|
}) => {
|
|
return (
|
|
<button
|
|
className={classNames(
|
|
`inline-flex items-center rounded shadow-sm focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2`,
|
|
disabled ? "disabled:opacity-50" : "",
|
|
fullwidth ? " w-full justify-center " : "",
|
|
small ? "px-2.5 py-1.5 text-xs" : "px-5 py-3 text-sm",
|
|
icon ? "px-1.5 py-1.5 text-xs" : "px-5 py-3 text-sm",
|
|
secondary ? "bg-ui-gray-light text-red" : "bg-snoopfade text-white"
|
|
)}
|
|
onClick={onClick}
|
|
disabled={disabled}
|
|
{...rest}>
|
|
{children}
|
|
</button>
|
|
);
|
|
};
|
|
|
|
export default StandardButton;
|