1"use strict"; 2var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { 3 if (k2 === undefined) k2 = k; 4 var desc = Object.getOwnPropertyDescriptor(m, k); 5 if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { 6 desc = { enumerable: true, get: function() { return m[k]; } }; 7 } 8 Object.defineProperty(o, k2, desc); 9}) : (function(o, m, k, k2) { 10 if (k2 === undefined) k2 = k; 11 o[k2] = m[k]; 12})); 13var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { 14 Object.defineProperty(o, "default", { enumerable: true, value: v }); 15}) : function(o, v) { 16 o["default"] = v; 17}); 18var __importStar = (this && this.__importStar) || function (mod) { 19 if (mod && mod.__esModule) return mod; 20 var result = {}; 21 if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); 22 __setModuleDefault(result, mod); 23 return result; 24}; 25Object.defineProperty(exports, "__esModule", { value: true }); 26exports.LogBoxButton = void 0; 27/** 28 * Copyright (c) 650 Industries. 29 * Copyright (c) Meta Platforms, Inc. and affiliates. 30 * 31 * This source code is licensed under the MIT license found in the 32 * LICENSE file in the root directory of this source tree. 33 */ 34const react_1 = __importStar(require("react")); 35const react_native_1 = require("react-native"); 36const LogBoxStyle = __importStar(require("./LogBoxStyle")); 37function LogBoxButton(props) { 38 const [pressed, setPressed] = (0, react_1.useState)(false); 39 let backgroundColor = props.backgroundColor; 40 if (!backgroundColor) { 41 backgroundColor = { 42 default: LogBoxStyle.getBackgroundColor(0.95), 43 pressed: LogBoxStyle.getBackgroundColor(0.6), 44 }; 45 } 46 const content = (react_1.default.createElement(react_native_1.View, { style: [ 47 { 48 backgroundColor: pressed ? backgroundColor.pressed : backgroundColor.default, 49 ...react_native_1.Platform.select({ 50 web: { 51 cursor: 'pointer', 52 }, 53 }), 54 }, 55 props.style, 56 ] }, props.children)); 57 return props.onPress == null ? (content) : (react_1.default.createElement(react_native_1.Pressable, { hitSlop: props.hitSlop, onPress: props.onPress, onPressIn: () => setPressed(true), onPressOut: () => setPressed(false) }, content)); 58} 59exports.LogBoxButton = LogBoxButton; 60//# sourceMappingURL=LogBoxButton.js.map