/
Alex_Ural
/
opencode
Обзор
Документация
Войти
/
Alex_Ural
/
opencode
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
packages/app/src/components/link.tsx
26 строк
645 B
Adam
chore: refactor packages/app files (#13236)
12 фев 2026, 18:49
Не верифицирован
12 фев 2026, 18:49
ff4414b
Код
Авторство
О чём код?
import { ComponentProps, splitProps } from "solid-js" import { usePlatform } from "@/context/platform" export interface LinkProps extends Omit<ComponentProps<"a">, "href"> { href: string } export function Link(props: LinkProps) { const platform = usePlatform() const [local, rest] = splitProps(props, ["href", "children", "class"]) return ( <a href={local.href} class={`text-text-strong underline ${local.class ?? ""}`} onClick={(event) => { if (!local.href) return event.preventDefault() platform.openLink(local.href) }} {...rest} > {local.children} </a> ) }