23 lines
569 B
TypeScript
23 lines
569 B
TypeScript
import type { FC, ReactNode } from 'react'
|
|
|
|
interface Props {
|
|
text: string | number | ReactNode,
|
|
children?: ReactNode,
|
|
dir?: string,
|
|
className?: string,
|
|
}
|
|
|
|
const Td: FC<Props> = (props: Props) => {
|
|
return (
|
|
<td className={`px-3 md:px-6 py-3 md:py-4 whitespace-nowrap text-xs ${props.className}`} style={{ direction: props.dir === "ltr" ? "ltr" : "rtl" }}>
|
|
{
|
|
props.text ?
|
|
props.text
|
|
:
|
|
props.children
|
|
}
|
|
</td>
|
|
)
|
|
}
|
|
|
|
export default Td |