import React from 'react' import { withKnobs } from '../../../storybook/node_modules/@storybook/addon-knobs' import { Table, TableCaption, TableRow, TableHead, TableCell, TableBody, Button, Icon, CheckBox, Link, CardTitle, } from '../..' import StoryWrapper from '../../utils/story-wrapper' export default { title: 'DesignSystem/Atoms/Table', decorators: [withKnobs], argTypes: { onClick: { action: 'clicked' }, }, } export const Default: React.FC = ({ onClick }) => { const handleClick = (event) => { event.preventDefault() onClick(event) } const header = ['Name', 'Surname', 'Gender', 'Age'] const data = [ ['John', 'Doe', 'Male', '57'], ['Joanna', 'K', 'Female', '32'], ['Patrick', 'Jogs', 'Male', '35'], ['Elisabeth', 'Briggs', 'Female', '28'], ['Jda', 'Karo', 'Female', '22'], ] return ( Example table: {header.map((head, i) => ( {head} {i === 0 && ( )} ))} {data.map((row) => ( {row.map((item) => ( {item} ))} ))}
) }