@brizy/ui
Version:
React elements in Brizy style
62 lines (61 loc) • 1.77 kB
JavaScript
import React from "react";
import { IconsName } from "../../EditorIcon/types";
import { Tab } from "../components/Tab";
import { EditorIcon } from "../../EditorIcon";
const options = {
left: [React.createElement(EditorIcon, { key: 1, icon: IconsName.ArrowRightLegacy })],
right: [React.createElement(EditorIcon, { key: 2, icon: IconsName.HeartLegacy })],
};
// this is used in docs and tests as Tabs children
export const tabChildrenTop = [
{
tab: {
value: "currentShortcodeTab",
key: "currentShortcodeTab",
label: "Button",
},
options: options.left,
},
{
tab: {
value: "currentShortcodeIconTab",
key: "currentShortcodeIconTab",
label: "Icon",
},
options: options.right,
},
];
export const tabChildrenSide = [
{
tab: {
value: "currentShortcodeTab",
key: "currentShortcodeTab",
icon: IconsName["t2-event-calendar"],
},
options: options.left,
},
{
tab: {
value: "currentShortcodeIconTab",
key: "currentShortcodeIconTab",
icon: IconsName.DuplicateLegacy,
},
options: options.right,
},
];
export const tabChildrenSingle = [
{
tab: {
value: "currentShortcodeTab",
key: "currentShortcodeTab",
label: "Button",
},
options: options.left,
},
];
export const tabChildrenMap = (tabChildren) => {
return tabChildren.map((children, idx) => {
const { tab, options } = children;
return (React.createElement(Tab, { key: idx, value: tab.value, label: tab.label, icon: tab.icon, title: tab.title }, options));
});
};