mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
* dbeaver/pro#5394 feat: null and boolean formatter for base grid * feat: reuse base grid formatters * chore: try to adjust workflow concurrency * chore: trigger workflow * chore: trigger workflow cancel * chore: fix label styles --------- Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com>
19 lines
481 B
TypeScript
19 lines
481 B
TypeScript
import { NullFormatter } from './NullFormatter.js';
|
|
|
|
interface Props {
|
|
value: number | null;
|
|
className?: string;
|
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
}
|
|
|
|
export function NumberFormatter({ value, className, onClick }: Props) {
|
|
if (value === null) {
|
|
return <NullFormatter className={className} onClick={onClick} />;
|
|
}
|
|
return (
|
|
<div style={{ textAlign: 'right' }} className={className} onClick={onClick}>
|
|
{value.toLocaleString()}
|
|
</div>
|
|
);
|
|
}
|