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};
25var __importDefault = (this && this.__importDefault) || function (mod) {
26    return (mod && mod.__esModule) ? mod : { "default": mod };
27};
28Object.defineProperty(exports, "__esModule", { value: true });
29exports.LogBoxInspectorFooter = void 0;
30/**
31 * Copyright (c) 650 Industries.
32 * Copyright (c) Meta Platforms, Inc. and affiliates.
33 *
34 * This source code is licensed under the MIT license found in the
35 * LICENSE file in the root directory of this source tree.
36 */
37const react_1 = __importDefault(require("react"));
38const react_native_1 = require("react-native");
39const LogContext_1 = require("../Data/LogContext");
40const LogBoxStyle = __importStar(require("../UI/LogBoxStyle"));
41function LogBoxInspectorFooter(props) {
42    const log = (0, LogContext_1.useSelectedLog)();
43    if (['static', 'syntax'].includes(log.level)) {
44        return (react_1.default.createElement(react_native_1.View, { style: styles.root },
45            react_1.default.createElement(react_native_1.View, { style: styles.button },
46                react_1.default.createElement(react_native_1.Text, { style: styles.syntaxErrorText }, "This error cannot be dismissed."))));
47    }
48    return (react_1.default.createElement(react_native_1.View, { style: styles.root },
49        react_1.default.createElement(FooterButton, { text: "Dismiss", onPress: props.onDismiss }),
50        react_1.default.createElement(FooterButton, { text: "Minimize", onPress: props.onMinimize })));
51}
52exports.LogBoxInspectorFooter = LogBoxInspectorFooter;
53function FooterButton({ text, onPress }) {
54    return (react_1.default.createElement(react_native_1.Pressable, { onPress: onPress, style: { flex: 1 } }, ({
55    /** @ts-expect-error: react-native types are broken. */
56    hovered, pressed, }) => (react_1.default.createElement(react_native_1.View, { style: [
57            buttonStyles.safeArea,
58            {
59                // @ts-expect-error: web-only type
60                transitionDuration: '150ms',
61                backgroundColor: pressed
62                    ? '#323232'
63                    : hovered
64                        ? '#111111'
65                        : LogBoxStyle.getBackgroundColor(),
66            },
67        ] },
68        react_1.default.createElement(react_native_1.View, { style: buttonStyles.content },
69            react_1.default.createElement(react_native_1.Text, { style: buttonStyles.label }, text))))));
70}
71const buttonStyles = react_native_1.StyleSheet.create({
72    safeArea: {
73        flex: 1,
74        borderTopWidth: 1,
75        borderColor: '#323232',
76        // paddingBottom: DeviceInfo.getConstants().isIPhoneX_deprecated ? 30 : 0,
77    },
78    content: {
79        alignItems: 'center',
80        height: 48,
81        justifyContent: 'center',
82    },
83    label: {
84        userSelect: 'none',
85        color: LogBoxStyle.getTextColor(1),
86        fontSize: 14,
87        includeFontPadding: false,
88        lineHeight: 20,
89    },
90});
91const styles = react_native_1.StyleSheet.create({
92    root: {
93        backgroundColor: LogBoxStyle.getBackgroundColor(1),
94        boxShadow: `0 -2px 0 2px #000`,
95        flexDirection: 'row',
96    },
97    button: {
98        flex: 1,
99    },
100    syntaxErrorText: {
101        textAlign: 'center',
102        width: '100%',
103        height: 48,
104        fontSize: 14,
105        lineHeight: 20,
106        paddingTop: 20,
107        paddingBottom: 50,
108        fontStyle: 'italic',
109        color: LogBoxStyle.getTextColor(0.6),
110    },
111});
112//# sourceMappingURL=LogBoxInspectorFooter.js.map