import { Flex, Group, Text } from '@mantine/core'; import { IconPlayerPlay, IconPlayerStop } from '@tabler/icons-react'; import React from 'react'; interface PlayControlProps { label: string, value: string, openVideoPlayer?: string, onClick?: (value: string) => void } const PlayControl = ({ label, value, openVideoPlayer, onClick }: PlayControlProps) => { const handleClick = (value: string) => { if (onClick) onClick(value) } return ( {label} { event.stopPropagation() handleClick(value) }}> {openVideoPlayer === value ? 'Stop Video' : 'Play Video'} {openVideoPlayer === value ? { event.stopPropagation() handleClick(value) }} /> : { event.stopPropagation() handleClick(value) }} /> } ) } export default PlayControl;