UNPKG

@neo4j-ndl/react

Version:

React implementation of Neo4j Design System

32 lines 2.07 kB
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime"; /** * * Copyright (c) "Neo4j" * Neo4j Sweden AB [http://neo4j.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css'; import { Menu } from '@neo4j-ndl/react'; import { AppearanceIcon, CheckCircleIconSolid, DatabaseSignalIcon, } from '@neo4j-ndl/react/icons'; import { TreeView } from '@neo4j-ndl/react/next'; import { useState } from 'react'; const Component = () => { const [selected, setSelected] = useState(null); return (_jsxs(TreeView, { ariaLabel: "Databases", children: [_jsx(TreeView.Item, { title: "Production", isSelected: selected === 'production', onSelectedChange: () => setSelected('production'), leadingVisual: _jsx(DatabaseSignalIcon, {}), trailingContent: _jsx(CheckCircleIconSolid, { className: "n-size-5 n-text-success-bg-status" }), actionMenuItems: _jsxs(_Fragment, { children: [_jsx(Menu.Item, { title: "Edit" }), _jsx(Menu.Item, { title: "Delete" }), _jsx(Menu.Item, { title: "Rename" })] }) }), _jsx(TreeView.Item, { title: "Development", isSelected: selected === 'development', onSelectedChange: () => setSelected('development'), leadingVisual: _jsx(DatabaseSignalIcon, {}), trailingContent: _jsx(AppearanceIcon, { className: "n-size-5 n-text-warning-bg-status" }) })] })); }; export default Component; //# sourceMappingURL=tree-view-trailing.story.js.map