UNPKG

react-native-tree-multi-select

Version:

A super-fast, customizable tree view component for React Native with multi-selection, checkboxes, and search filtering capabilities.

38 lines (35 loc) 1.18 kB
"use strict"; import React from "react"; import { jsx as _jsx } from "react/jsx-runtime"; // Function to dynamically load FontAwesomeIcon from either Expo or React Native function loadFontAwesomeIcon() { try { return require("@expo/vector-icons/FontAwesome").default; } catch (e) { try { return require("react-native-vector-icons/FontAwesome").default; } catch (error) { console.error("No FontAwesome icon library found. Please install either @expo/vector-icons or react-native-vector-icons"); return null; } } } // Load the FontAwesomeIcon component const FontAwesomeIcon = loadFontAwesomeIcon(); export const CustomExpandCollapseIcon = /*#__PURE__*/React.memo(_CustomExpandCollapseIcon); function _CustomExpandCollapseIcon(props) { const { isExpanded } = props; // If FontAwesomeIcon is not available, render a fallback or null if (!FontAwesomeIcon) { console.warn("FontAwesomeIcon is not available"); return null; } return /*#__PURE__*/_jsx(FontAwesomeIcon, { name: isExpanded ? "caret-down" : "caret-right", size: 20, color: "black" }); } //# sourceMappingURL=CustomExpandCollapseIcon.js.map