mirror of
https://github.com/SigNoz/signoz.git
synced 2026-06-01 14:50:29 +01:00
Some checks failed
build-staging / prepare (push) Has been cancelled
build-staging / go-build (push) Has been cancelled
build-staging / staging (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
build-staging / js-build (push) Has been cancelled
41 lines
978 B
TypeScript
41 lines
978 B
TypeScript
import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';
|
|
import cx from 'classnames';
|
|
|
|
import tableStyles from './TanStackTable.module.scss';
|
|
|
|
type BaseProps = Omit<
|
|
HTMLAttributes<HTMLSpanElement>,
|
|
'children' | 'dangerouslySetInnerHTML'
|
|
> & {
|
|
className?: string;
|
|
};
|
|
|
|
type WithChildren = BaseProps & {
|
|
children: ReactNode;
|
|
dangerouslySetInnerHTML?: never;
|
|
};
|
|
|
|
type WithDangerousHtml = BaseProps & {
|
|
children?: never;
|
|
dangerouslySetInnerHTML: { __html: string };
|
|
};
|
|
|
|
export type TanStackTableTextProps = WithChildren | WithDangerousHtml;
|
|
|
|
const TanStackTableText = forwardRef<HTMLSpanElement, TanStackTableTextProps>(
|
|
({ children, className, dangerouslySetInnerHTML, ...rest }, ref) => (
|
|
<span
|
|
ref={ref}
|
|
className={cx(tableStyles.tableCellText, className)}
|
|
dangerouslySetInnerHTML={dangerouslySetInnerHTML}
|
|
{...rest}
|
|
>
|
|
{children}
|
|
</span>
|
|
),
|
|
);
|
|
|
|
TanStackTableText.displayName = 'TanStackTableText';
|
|
|
|
export default TanStackTableText;
|