PHP 8.2.30
Preview: tab.js Size: 654 B
//proc/thread-self/root/home/byroehnu/.trash/node_modules11/@adminjs/design-system/build/atoms/tabs/tab.js

import React, { useLayoutEffect } from 'react';
import { useTabs } from "./tabs.js";
/**
 * Renders children inside Tabs component. Each Tab will add a single tab in
 * the navigation bar.
 */
export const Tab = ({
  id,
  label,
  children
}) => {
  const {
    currentTab,
    registerTab,
    unregisterTab
  } = useTabs();
  useLayoutEffect(() => {
    registerTab(id, label);
    return () => unregisterTab(id);
  });
  if (id !== currentTab) {
    return null;
  }

  // eslint-disable-next-line react/jsx-no-useless-fragment
  return /*#__PURE__*/React.createElement(React.Fragment, null, children);
};
Tab.displayName = 'Tab';
export default Tab;

Directory Contents

Dirs: 0 × Files: 4

Name Size Perms Modified Actions
52 B lrw-r--r-- 2026-02-28 00:31:26
Edit Download
654 B lrw-r--r-- 2026-02-28 00:31:36
Edit Download
3.24 KB lrw-r--r-- 2026-02-28 00:31:38
Edit Download
773 B lrw-r--r-- 2026-02-28 00:31:38
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).