import type { Meta, StoryObj } from '@storybook/react'; import TableTree from './TableTree'; import Button from '../Button'; import treeData from './data'; import Typography from '../Typography/Typography'; import Icon from '../Icon/Icon'; import Chip from '../Chip/Chip'; import './TableTreeStories.scss'; const meta: Meta = { title: 'Components/Table tree', component: TableTree, tags: ['autodocs'], }; type Story = StoryObj; // NOTE :: For Action section use ff-action-section classname // TODO :: below code is a temporary will Modify later const createTilteAndAction = (row: any): JSX.Element => { if (row?.folder) { return (
{`${row?.title} - Action Folder lenthy name`}
); } else { return (
{`${row.title} - Action File with lenthy name`}
); } }; export const Default: Story = { args: { withCheckBox: false, treeData, columnsData: [ { name: 'Script Name', accessor: 'title', width: '400px', isClickable: true, cell: (e) => { return createTilteAndAction(e.row); }, }, { name: 'Module Path', accessor: 'path', width: '200px', isClickable: true, }, { name: 'Created By', accessor: 'createdByUname', width: '200px' }, { name: 'Script Count', accessor: 'moduleLevelScriptCount', width: '200px', }, { name: 'state', accessor: 'state', width: '100px', cell: ({ value }) => { return ( value && ( ) ); }, }, ], onClick: (e, data) => { console.log('🚀 ~ e, data:', e, data); //Todo:need to remove }, }, }; export default meta;