14 lines
399 B
TypeScript
14 lines
399 B
TypeScript
const assetBase = import.meta.env.BASE_URL || '/';
|
|
|
|
export function getPublicAssetUrl(path: string) {
|
|
if (!path) {
|
|
return assetBase;
|
|
}
|
|
const normalizedPath = path.startsWith('/') ? path.slice(1) : path;
|
|
return `${assetBase}${normalizedPath}`;
|
|
}
|
|
|
|
export function getEmptyStateImageUrl(themeMode?: string) {
|
|
return getPublicAssetUrl(`empty${themeMode === 'dark' ? '-dark' : ''}.png`);
|
|
}
|