Skip to content

Commit 926d665

Browse files
waleedlatif1claude
andcommitted
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>
1 parent 80f0047 commit 926d665

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

apps/docs/components/ui/action-media.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,19 @@ interface ActionVideoProps {
1212
alt: string
1313
}
1414

15+
/**
16+
* Normalize path for blob storage
17+
* - Strips leading slash
18+
* - Strips 'static/' prefix
19+
*/
20+
function normalizeBlobPath(src: string): string {
21+
let path = src.startsWith('/') ? src.slice(1) : src
22+
path = path.replace(/^static\//, '')
23+
return path
24+
}
25+
1526
export function ActionImage({ src, alt }: ActionImageProps) {
16-
const resolvedSrc = getAssetUrl(src.startsWith('/') ? src.slice(1) : src)
27+
const resolvedSrc = src.startsWith('/') ? src : `/${src}`
1728

1829
return (
1930
<img
@@ -25,7 +36,7 @@ export function ActionImage({ src, alt }: ActionImageProps) {
2536
}
2637

2738
export function ActionVideo({ src, alt }: ActionVideoProps) {
28-
const resolvedSrc = getAssetUrl(src.startsWith('/') ? src.slice(1) : src)
39+
const resolvedSrc = getAssetUrl(normalizeBlobPath(src))
2940

3041
return (
3142
<video

0 commit comments

Comments
 (0)