Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

684 B
Raw Blame
export type InvokeIconMode = { mode: 'front' } | { mode: 'play' } | { mode: 'progress'; value: number | null };

/** Replace play with progress only when running without hover or keyboard focus-visible. */
export const getInvokeIconMode = ({
  hasOpenWork,
  isFrontHeld,
  isHovered,
  progress,
}: {
  hasOpenWork: boolean;
  /** Shift is held and a click would queue: callers pass false while Invoke cannot queue. */
  isFrontHeld: boolean;
  isHovered: boolean;
  progress: number | null;
}): InvokeIconMode => {
  if (hasOpenWork && !isHovered) {
    return { mode: 'progress', value: progress };
  }

  return isHovered && isFrontHeld ? { mode: 'front' } : { mode: 'play' };
};