Skip to content

Open source alternative to Semrush and Ahrefs

674 B
Raw Blame
import { Button } from "@/client/components/ui/button";

/** The Cancel and submit buttons at the end of a form. */
export function FormActions({
  pending,
  disabled = false,
  onCancel,
  size = "default",
}: {
  pending: boolean;
  disabled?: boolean;
  onCancel: () => void;
  size?: "xs" | "sm" | "default";
}) {
  return (
    <div className="flex justify-end gap-2">
      <Button
        type="button"
        variant="ghost"
        size={size}
        onClick={onCancel}
        disabled={pending}
      >
        Cancel
      </Button>
      <Button type="submit" size={size} disabled={disabled} pending={pending}>
        Save
      </Button>
    </div>
  );
}