import React from 'react';
import Typography from '../../Typography';

const AxisLabel = ({
  label,
  numberOfLines = 1,
  textAlign = 'right',
}: {
  label: string;
  numberOfLines?: number;
  textAlign?: 'right' | 'center';
}) => (
  <Typography.Label
    style={{ textAlign }}
    intent="subdued"
    ellipsizeMode="tail"
    numberOfLines={numberOfLines}
    adjustsFontSizeToFit
    minimumFontScale={0.6}
  >
    {label}
  </Typography.Label>
);

export default AxisLabel;
