import React, { FC } from 'react'; import { Person } from 'react-bootstrap-icons'; import type { Meta, StoryObj } from '@storybook/react'; import { RBTable } from '../table.components'; import type { RBTColumnDefs, RBTColumnCellDef } from '../../common'; import { SimpleDataset } from '../../common/common.testdata'; import type { SimpleDataType } from '../../common/common.testdata'; const meta = { title: 'react-bootstrap-table/Table', component: RBTable, tags: ['autodocs'], } satisfies Meta>; export default meta; type Story = StoryObj; const SimpleColumnDefs: RBTColumnDefs[] = [ { Cell: (props: RBTColumnCellDef) => ModifiedFirstNameCell(props), header: 'Name', }, { Cell: (props: RBTColumnCellDef) => ModifiedAgeCell(props), header: 'Age', }, ]; const ModifiedAgeCell: FC> = ({ originalRow }) => { return

{originalRow.age}

; }; const ModifiedFirstNameCell: FC> = ({ originalRow }) => { return (

{originalRow.firstName} {originalRow.surname}

); }; export const ModifiedCellFn: Story = { args: { columns: SimpleColumnDefs, data: SimpleDataset, header: { enableTableHead: false }, footer: { enablePagination: false }, }, };