Skip to content

A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search

478 B
Raw Blame
import type { PressableProps } from "react-native";
import { ActivityIndicator, Pressable } from "react-native";

export function ActionButton({
  children,
  loading,
  disabled,
  ...props
}: PressableProps & {
  loading: boolean;
}) {
  if (disabled !== undefined) {
    disabled ||= loading;
  } else if (loading) {
    disabled = true;
  }
  return (
    <Pressable {...props} disabled={disabled}>
      {loading ? <ActivityIndicator /> : children}
    </Pressable>
  );
}