@@ -3,6 +3,7 @@ import React, { useEffect, useState, memo, useCallback } from "react";
33import { Modal , Button , Form , Row , Col , OverlayTrigger , Tooltip } from "react-bootstrap" ;
44import useAPI from "../../hooks/useAPI" ;
55import { HttpMethod } from "../../utils/httpMethods" ;
6+ import { publicUrl } from "../../utils/publicUrl" ;
67
78/* =============================================================================
89 Shared visual style — same as CreateTeams.tsx
@@ -26,19 +27,7 @@ const TABLE_TEXT: React.CSSProperties = {
2627 Icon utilities — same pattern as Import modal
2728============================================================================= */
2829
29- const getBaseUrl = ( ) : string => {
30- if ( typeof document !== 'undefined' ) {
31- const base = document . querySelector ( 'base[href]' ) as HTMLBaseElement | null ;
32- if ( base ?. href ) return base . href . replace ( / \/ $ / , '' ) ;
33- }
34- const fromGlobal = ( globalThis as any ) ?. __BASE_URL__ ;
35- if ( typeof fromGlobal === 'string' && fromGlobal ) return fromGlobal . replace ( / \/ $ / , '' ) ;
36- const fromProcess =
37- ( typeof process !== 'undefined' && ( process as any ) ?. env ?. PUBLIC_URL ) || '' ;
38- return String ( fromProcess ) . replace ( / \/ $ / , '' ) ;
39- } ;
40-
41- const assetUrl = ( rel : string ) => `${ getBaseUrl ( ) } /${ rel . replace ( / ^ \/ / , '' ) } ` ;
30+ const assetUrl = ( rel : string ) => publicUrl ( rel . replace ( / ^ \/ / , '' ) ) ;
4231
4332
4433
0 commit comments