Skip to content

Commit 1225a9e

Browse files
committed
feat(BlueprintAssetIcon): support data urls
1 parent a93f8c2 commit 1225a9e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/webui/src/client/lib/Components/BlueprintAssetIcon.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const GLOBAL_BLUEPRINT_ASSET_CACHE: Record<string, string> = {}
55

66
export function BlueprintAssetIcon({ src, className }: { src: string; className?: string }): JSX.Element | null {
77
const url = useMemo(() => {
8+
if (src.startsWith('data:')) return new URL(src)
89
return new URL(createPrivateApiPath('/blueprints/assets/' + src), location.href)
910
}, [src])
1011
const [svgAsset, setSvgAsset] = useState<string | null>(GLOBAL_BLUEPRINT_ASSET_CACHE[url.href] ?? null)

0 commit comments

Comments
 (0)