/
githubmirror
/
traefik
Обзор
Документация
Войти
/
githubmirror
/
traefik
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
webui/src/components/tables/ClickableRow.tsx
29 строк
802 B
Murat Aslan
Display server weight in service detail view
30 мар 2026, 17:58
Не верифицирован
30 мар 2026, 17:58
9a8ff96
Код
Авторство
О чём код?
import { AriaTr, VariantProps, styled } from '@traefik-labs/faency' import { ComponentProps, forwardRef, ReactNode } from 'react' import { useHrefWithReturnTo } from 'hooks/use-href-with-return-to' const UnstyledLink = styled('a', { color: 'inherit', textDecoration: 'inherit', fontWeight: 'inherit', '&:hover': { cursor: 'pointer', }, }) type ClickableRowProps = ComponentProps<typeof AriaTr> & VariantProps<typeof AriaTr> & { children: ReactNode to: string } export default forwardRef<HTMLTableRowElement | null, ClickableRowProps>(({ children, css, to, ...props }, ref) => { const href = useHrefWithReturnTo(to) return ( <AriaTr asChild interactive ref={ref} css={css} {...props}> <UnstyledLink href={href}>{children}</UnstyledLink> </AriaTr> ) })