PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.9.5
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.9.5
4.9.5 4.9.4 4.9.3 4.9.2 4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 All 203 releases
betterdocs / react-src / gutenberg / components / partials / IconLayoutTwo.js

IconLayoutTwo.js in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 4.9.5, at react-src/gutenberg/components/partials/IconLayoutTwo.js

46 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import FolderIcon from "../icons/FolderIcon";
2 import FolderOpenIcon from "../icons/FolderOpenIcon";
3
4 const IconLayoutTwo = ({icon, categoryIcon = 'folder'}) => {
5 const renderIcon = () => {
6 // If custom image is provided and categoryIcon is not 'custom', show image in folder wrapper
7 if (icon && categoryIcon !== 'custom') {
8 return <img className="betterdocs-category-folder-img" src={icon}/>;
9 }
10
11 // If custom image is provided and categoryIcon is 'custom', show just the image
12 if (icon && categoryIcon === 'custom') {
13 return <img alt="betterdocs-category-icon" className="betterdocs-category-icon-img" src={icon}/>;
14 }
15
16 // Show folder icons based on categoryIcon setting
17 if (categoryIcon === 'folder-open') {
18 return <FolderOpenIcon/>;
19 }
20
21 return <FolderIcon/>;
22 };
23
24 // For custom icons, don't wrap in folder span
25 if (categoryIcon === 'custom') {
26 return (
27 <div className="betterdocs-category-icon">
28 {renderIcon()}
29 </div>
30 );
31 }
32
33 // For folder icons, wrap in folder span with appropriate arrow class
34 const arrowClass = categoryIcon === 'folder-open' ? 'arrow-down' : 'arrow-right';
35
36 return (
37 <div className="betterdocs-category-icon">
38 <span className={`betterdocs-folder-icon toggle-arrow ${arrowClass}`}>
39 {renderIcon()}
40 </span>
41 </div>
42 );
43 }
44
45 export default IconLayoutTwo;
46