From af2691d3d65b349e30f03db8e8eae901164eebc0 Mon Sep 17 00:00:00 2001 From: ikramBagban <107988060+IkramBagban@users.noreply.github.com> Date: Sun, 8 Dec 2024 14:17:42 +0530 Subject: [PATCH] feat: Add tooltip to display full section name when hovering over the section button #1569 --- src/components/VideoContentChapters.tsx | 38 ++++++++++++++++--------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/src/components/VideoContentChapters.tsx b/src/components/VideoContentChapters.tsx index e7a2818a7..f224f5108 100644 --- a/src/components/VideoContentChapters.tsx +++ b/src/components/VideoContentChapters.tsx @@ -3,6 +3,7 @@ import { Segment, formatTime } from '@/lib/utils'; import { useEffect, useState } from 'react'; import { motion } from 'framer-motion'; import videojs from 'video.js'; +import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './ui/tooltip'; const chaptersVariants = { open: { @@ -66,20 +67,29 @@ const VideoContentChapters = ({
{(segments as Segment[])?.map(({ start, end, title }, index) => { return ( -
-
= start && currentTime < end ? 'bg-blue-500/10' : 'bg-primary/5'}`} - onClick={() => { - player.currentTime(start); - player.play(); - }} - > -

{title}

- - {formatTime(start)} - -
-
+ + +
+
= start && currentTime < end ? 'bg-blue-500/10' : 'bg-primary/5'}`} + onClick={() => { + player.currentTime(start); + player.play(); + }} + > + +

{title}

+
+ +

{title}

+
+ + {formatTime(start)} + +
+
+
+
); })}