import { type GraphLabelData } from '@/page-layout/widgets/graph/types/GraphLabelData'; import { calculateGraphLabelStyles } from '@/page-layout/widgets/graph/utils/calculateGraphLabelStyles'; import { useTheme } from '@emotion/react'; import { animated } from '@react-spring/web'; import { isDefined } from 'twenty-shared/utils'; type GraphDataLabelProps = { label: GraphLabelData; formatValue?: (value: number) => string; offset: number; isVerticalLayout: boolean; }; export const GraphDataLabel = ({ label, formatValue, offset, isVerticalLayout, }: GraphDataLabelProps) => { const theme = useTheme(); const styles = calculateGraphLabelStyles(label, offset, isVerticalLayout); return ( {isDefined(formatValue) ? formatValue(label.value) : label.value} ); };