MCPcopy Index your code
hub / github.com/OpenPipe/OpenPipe / ActionButton

Function ActionButton

app/src/components/ActionButton.tsx:8–50  ·  view source on GitHub ↗
({
  icon,
  iconBoxSize = 3.5,
  label,
  requireBeta = false,
  onClick,
  ...buttonProps
}: {
  icon: IconType;
  iconBoxSize?: number;
  label: string;
  requireBeta?: boolean;
  onClick?: () => void;
} & ButtonProps)

Source from the content-addressed store, hash-verified

6import { useIsMissingBetaAccess } from "~/utils/hooks";
7
8const ActionButton = ({
9 icon,
10 iconBoxSize = 3.5,
11 label,
12 requireBeta = false,
13 onClick,
14 ...buttonProps
15}: {
16 icon: IconType;
17 iconBoxSize?: number;
18 label: string;
19 requireBeta?: boolean;
20 onClick?: () => void;
21} & ButtonProps) => {
22 const isMissingBetaAccess = useIsMissingBetaAccess();
23
24 const [betaModalOpen, setBetaModalOpen] = useState(false);
25
26 const isBetaBlocked = requireBeta && isMissingBetaAccess;
27 return (
28 <>
29 <Button
30 colorScheme="blue"
31 color="black"
32 bgColor="white"
33 borderColor="gray.300"
34 borderRadius={4}
35 variant="outline"
36 size="sm"
37 fontSize="sm"
38 fontWeight="normal"
39 onClick={isBetaBlocked ? () => setBetaModalOpen(true) : onClick}
40 {...buttonProps}
41 >
42 <HStack spacing={1}>
43 {icon && <Icon as={icon} boxSize={iconBoxSize} color="orange.400" />}
44 <Text display={{ base: "none", md: "flex" }}>{label}</Text>
45 </HStack>
46 </Button>
47 <BetaModal isOpen={betaModalOpen} onClose={() => setBetaModalOpen(false)} />
48 </>
49 );
50};
51
52export default ActionButton;

Callers

nothing calls this directly

Calls 1

useIsMissingBetaAccessFunction · 0.90

Tested by

no test coverage detected