fix(docs): separate local and blob asset resolution for quick-reference

ActionImage now uses local paths directly for PNGs while ActionVideo
uses blob storage with proper path normalization (strips static/ prefix).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Waleed Latif
2026-01-26 10:07:10 -08:00
parent 80f00479a3
commit 926d665279

View File

@@ -12,8 +12,19 @@ interface ActionVideoProps {
alt: string
}
/**
* Normalize path for blob storage
* - Strips leading slash
* - Strips 'static/' prefix
*/
function normalizeBlobPath(src: string): string {
let path = src.startsWith('/') ? src.slice(1) : src
path = path.replace(/^static\//, '')
return path
}
export function ActionImage({ src, alt }: ActionImageProps) {
const resolvedSrc = getAssetUrl(src.startsWith('/') ? src.slice(1) : src)
const resolvedSrc = src.startsWith('/') ? src : `/${src}`
return (
<img
@@ -25,7 +36,7 @@ export function ActionImage({ src, alt }: ActionImageProps) {
}
export function ActionVideo({ src, alt }: ActionVideoProps) {
const resolvedSrc = getAssetUrl(src.startsWith('/') ? src.slice(1) : src)
const resolvedSrc = getAssetUrl(normalizeBlobPath(src))
return (
<video