import RTEExtensionContextManager from '../../../helpers/extension-context-manager';
/**
 * Base renderer for table-related popovers, providing common functionalities such as accessing the table extension context.
 */
export class TablePopoverBaseRenderer {
  constructor(renderContext) {
    this.renderContext = renderContext;
  }
  /**
   * Retrieves the table extension context associated with the current render context.
   *
   * @returns {Nullable<RTETableExtensionContext>} The table extension context if available, otherwise null.
   */
  getTableExtensionContext() {
    return this.renderContext
      ? RTEExtensionContextManager.getExtensionContext(this.renderContext.host)
      : null;
  }
}
