import { ComponentProps, splitProps } from "solid-js" import { usePlatform } from "@/context/platform" export interface LinkProps extends Omit, "href"> { href: string } export function Link(props: LinkProps) { const platform = usePlatform() const [local, rest] = splitProps(props, ["href", "children", "class"]) return ( { if (!local.href) return event.preventDefault() platform.openLink(local.href) }} {...rest} > {local.children} ) }