Files
Jonathan Summers-MuirandIvan Vasilov 846b470f9d chore: uses iframes for UI lib examples. (#34419)
* init

* Update component-preview.tsx

* please note: changed redirects in block, so need to update the logic to find and replace the redirects

* Fix the redirect urls to work when installing and in examples.

* Revert some of the changes.

* Add a step when building the registry to clean the registry of example code.

* Fix the clean registry script.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2025-03-26 11:16:09 +01:00

12 lines
519 B
TypeScript

import { type ComponentPropsWithoutRef } from 'react'
import { cn } from 'ui'
export function Link({ className, href, ...props }: ComponentPropsWithoutRef<'a'>) {
// A simplified link component for UI Library examples
// Renders as a regular <a> tag to support iframe base path routing
// Remove leading slash for relative paths to work with base tag
const relativeHref = href?.startsWith('/') ? href.slice(1) : href
return <a {...props} href={relativeHref} className={cn('cursor-pointer', className)} />
}