refactor(docs): simplify asset resolution by using correct paths directly

Remove path normalization logic from action-media component. Instead,
use the appropriate paths in MDX:
- PNGs: /static/quick-reference/... (local)
- MP4s: quick-reference/... (blob via getAssetUrl)
This commit is contained in:
Waleed Latif
2026-01-26 10:11:32 -08:00
parent 926d665279
commit b04f8ca344
2 changed files with 21 additions and 34 deletions

View File

@@ -12,23 +12,10 @@ 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 = src.startsWith('/') ? src : `/${src}`
return (
<img
src={resolvedSrc}
src={src}
alt={alt}
className='inline-block w-full max-w-[200px] rounded border border-neutral-200 dark:border-neutral-700'
/>
@@ -36,7 +23,7 @@ export function ActionImage({ src, alt }: ActionImageProps) {
}
export function ActionVideo({ src, alt }: ActionVideoProps) {
const resolvedSrc = getAssetUrl(normalizeBlobPath(src))
const resolvedSrc = getAssetUrl(src)
return (
<video