import { Disclosure, Transition } from '@headlessui/react' import { ChevronDownIcon } from '@heroicons/react/solid' import { Fragment, ReactNode } from 'react' import dayjs from 'dayjs' export const Table = ({ children }) => ( {children}
) export const TrHead = ({ children }) => ( {children} ) export const Th = ({ children }) => ( {children} ) export const TrBody = ({ children, className = '' }) => ( {children} ) export const Td = ({ children, className, }: { children: ReactNode className?: string }) => ( {children} ) type ExpandableRowProps = { buttonTemplate: React.ReactNode panelTemplate: React.ReactNode rounded?: boolean } export const ExpandableRow = ({ buttonTemplate, panelTemplate, rounded, }: ExpandableRowProps) => { return ( {({ open }) => ( <> {buttonTemplate}
{panelTemplate}
)}
) } type RowProps = { children: React.ReactNode } export const Row = ({ children }: RowProps) => { return (
{children}
) } export const TableDateDisplay = ({ date, showSeconds, }: { date: string | number showSeconds?: boolean }) => ( <>

{dayjs(date).format('DD MMM YYYY')}

{dayjs(date).format(showSeconds ? 'h:mm:ssa' : 'h:mma')}

)