mirror of
https://github.com/simstudioai/sim.git
synced 2026-02-06 12:45:07 -05:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user