You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
869 B
45 lines
869 B
import type { ReactNode } from 'react'
|
|
import { Fragment } from 'react'
|
|
|
|
import styled from 'styled-components/macro'
|
|
|
|
import { TooltipBlockWrapper } from 'features/UserFavorites/TooltipBlock/styled'
|
|
import { T9n } from 'features/T9n'
|
|
|
|
export const TooltipWrapper = styled(TooltipBlockWrapper)`
|
|
position: absolute;
|
|
top: calc(100% + 0.38rem);
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
padding: 0.38rem 0.567rem;
|
|
font-weight: normal;
|
|
font-size: 0.65rem;
|
|
line-height: 0.85rem;
|
|
text-align: center;
|
|
display: none;
|
|
|
|
&::before {
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
}
|
|
`
|
|
|
|
type Props = {
|
|
children?: ReactNode,
|
|
lexic: string,
|
|
}
|
|
|
|
export const Tooltip = ({
|
|
children,
|
|
lexic,
|
|
}: Props) => (
|
|
<Fragment>
|
|
<TooltipWrapper
|
|
role='tooltip'
|
|
top={0}
|
|
>
|
|
<T9n t={lexic} />
|
|
</TooltipWrapper>
|
|
{children}
|
|
</Fragment>
|
|
)
|
|
|