import {GradientProps} from '@components/_core';

import {
  AI_BUTTON_GRADIENT_LOCATION_DEFAULT,
  AI_BUTTON_GRADIENT_LOCATION_EXPANDED,
} from '../../constants';

export const getGradientLocations = (
  progress: number,
): GradientProps['locations'] => {
  const blueStop =
    AI_BUTTON_GRADIENT_LOCATION_DEFAULT +
    (AI_BUTTON_GRADIENT_LOCATION_EXPANDED -
      AI_BUTTON_GRADIENT_LOCATION_DEFAULT) *
      progress;

  return [0, blueStop];
};
