mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-10 18:57:06 +00:00
bf6f7430e7
Mark JS imports as type-only when applicable so they are stripped at build time and ignored during chunk splitting, ensuring we take full advantage of Rollup's code-splitting optimizations.
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
import type { Participant } from 'livekit-client'
|
|
import { menuRecipe } from '@/primitives/menuRecipe'
|
|
import { HStack } from '@/styled-system/jsx'
|
|
import { RiPushpin2Line, RiUnpinLine } from '@remixicon/react'
|
|
import { MenuItem } from 'react-aria-components'
|
|
import { useTranslation } from 'react-i18next'
|
|
import { useFocusToggleParticipant } from '@/features/rooms/livekit/hooks/useFocusToggleParticipant'
|
|
|
|
export const PinMenuItem = ({ participant }: { participant: Participant }) => {
|
|
const { t } = useTranslation('rooms', { keyPrefix: 'participantMenu' })
|
|
|
|
const { toggle, inFocus } = useFocusToggleParticipant(participant)
|
|
|
|
return (
|
|
<MenuItem
|
|
aria-label={t(`${inFocus ? 'unpin' : 'pin'}.ariaLabel`, {
|
|
name: participant.name,
|
|
})}
|
|
className={menuRecipe({ icon: true }).item}
|
|
onAction={toggle}
|
|
>
|
|
<HStack gap={0.25}>
|
|
{inFocus ? (
|
|
<>
|
|
<RiUnpinLine size={20} aria-hidden />
|
|
{t('unpin.label')}
|
|
</>
|
|
) : (
|
|
<>
|
|
<RiPushpin2Line size={20} aria-hidden />
|
|
{t('pin.label')}
|
|
</>
|
|
)}
|
|
</HStack>
|
|
</MenuItem>
|
|
)
|
|
}
|