(null)
+ const [isTruncated, setIsTruncated] = useState(false)
-const Row = classed.tr`*:border-default last:*:border-b *:first:border-l *:last:border-r`
+ const inner = (
+ {
+ const el = ref.current
+ setIsTruncated(!!el && el.scrollWidth > el.clientWidth)
+ }}
+ >
+ {text}
+
+ )
-const Cell = ({ children }: Children) => {
- return (
-
- {children}
- |
+ return isTruncated ? (
+
+ {inner}
+
+ ) : (
+ inner
)
}
-const EmptyState = (props: { title: string; body: string; colSpan: number }) => (
-
- |
-
-
-
+const EmptyState = (props: { title: string; body: string }) => (
+ |
+ |
+
|
-
-)
-
-export const InputCell = ({
- colSpan,
- defaultValue,
- placeholder,
-}: {
- colSpan?: number
- defaultValue: string
- placeholder: string
-}) => (
-
-
-
-
- |
+
)
// followed this for icon in button best practices
// https://www.sarasoueidan.com/blog/accessible-icon-buttons/
const RemoveCell = ({ onClick, label }: { onClick: () => void; label: string }) => (
-
- |