Brijesh's Git Server — watchman-frontend @ main

admin site for watchman

src/components/Button.tsx (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
const PrimaryButton = ({
  text,
  onClick = () => {},
  disabled = false,
  type = "button",
  intent = "primary",
}: {
  text: string;
  onClick?: () => void;
  disabled?: boolean;
  type?: "button" | "submit" | "reset";
  intent?: "primary" | "danger";
}) => {
  return (
    <div>
      <button
        onClick={onClick}
        disabled={disabled}
        type={type}
        className={`text-white font-medium px-2 py-1 rounded ${
          intent === "primary"
            ? "bg-slate-700 disabled:bg-slate-500"
            : "bg-red-700 disabled:bg-red-500"
        }`}
      >
        {text}
      </button>
    </div>
  );
};

export { PrimaryButton };