react-native-tree-multi-select
Version:
Super-fast, customizable tree view component for React Native with drag-and-drop reordering, multi-selection, and search filtering.
38 lines (35 loc) • 1.17 kB
JavaScript
;
import { memo } 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__*/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