1/**
2 * Copyright (c) 650 Industries.
3 * Copyright (c) Meta Platforms, Inc. and affiliates.
4 *
5 * This source code is licensed under the MIT license found in the
6 * LICENSE file in the root directory of this source tree.
7 */
8import React from 'react';
9import { StyleSheet, Text, View } from 'react-native';
10import { LogBoxButton } from '../UI/LogBoxButton';
11import * as LogBoxStyle from '../UI/LogBoxStyle';
12import { CODE_FONT } from '../UI/constants';
13import { getStackFormattedLocation } from '../formatProjectFilePath';
14export function LogBoxInspectorStackFrame(props) {
15    const { frame, onPress } = props;
16    const location = getStackFormattedLocation(process.env.EXPO_PROJECT_ROOT, frame);
17    return (React.createElement(View, { style: styles.frameContainer },
18        React.createElement(LogBoxButton, { backgroundColor: {
19                default: 'transparent',
20                pressed: onPress ? LogBoxStyle.getBackgroundColor(1) : 'transparent',
21            }, onPress: onPress, style: styles.frame },
22            React.createElement(Text, { style: [styles.name, frame.collapse === true && styles.dim] }, frame.methodName),
23            React.createElement(Text, { ellipsizeMode: "middle", numberOfLines: 1, style: [styles.location, frame.collapse === true && styles.dim] }, location))));
24}
25const styles = StyleSheet.create({
26    frameContainer: {
27        flexDirection: 'row',
28        paddingHorizontal: 15,
29    },
30    frame: {
31        flex: 1,
32        paddingVertical: 4,
33        paddingHorizontal: 10,
34        borderRadius: 5,
35    },
36    lineLocation: {
37        flexDirection: 'row',
38    },
39    name: {
40        color: LogBoxStyle.getTextColor(1),
41        fontSize: 14,
42        includeFontPadding: false,
43        lineHeight: 18,
44        fontWeight: '400',
45        fontFamily: CODE_FONT,
46    },
47    location: {
48        color: LogBoxStyle.getTextColor(0.8),
49        fontSize: 12,
50        fontWeight: '300',
51        includeFontPadding: false,
52        lineHeight: 16,
53        paddingLeft: 10,
54    },
55    dim: {
56        color: LogBoxStyle.getTextColor(0.4),
57        fontWeight: '300',
58    },
59    line: {
60        color: LogBoxStyle.getTextColor(0.8),
61        fontSize: 12,
62        fontWeight: '300',
63        includeFontPadding: false,
64        lineHeight: 16,
65    },
66});
67//# sourceMappingURL=LogBoxInspectorStackFrame.js.map