import dayjs from 'dayjs'
import { ReactNode, forwardRef } from 'react'
export const Table = ({
children,
className,
}: {
children: ReactNode
className?: string
}) =>
export const TrHead = ({
children,
className,
}: {
children: ReactNode
className?: string
}) => {children}
export const Th = ({
children,
className,
id,
xBorder = false,
}: {
children?: ReactNode
className?: string
id?: string
xBorder?: boolean
}) => (
{children}
|
)
interface TrBodyProps {
children: ReactNode
className?: string
onClick?: () => void
}
export const TrBody = forwardRef(
(props, ref) => {
const { children, className, onClick } = props
return (
{children}
)
}
)
TrBody.displayName = 'TrBody'
export const Td = ({
children,
className,
xBorder = false,
}: {
children: ReactNode
className?: string
xBorder?: boolean
}) => (
{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')}
>
)