mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-26 01:06:23 +02:00
refactor: update icon usage in CommentActions and enhance Tooltip component for mobile responsiveness
This commit is contained in:
parent
1f162f52c3
commit
c9e5fe9cdb
6 changed files with 113 additions and 138 deletions
|
|
@ -12,7 +12,6 @@ import {
|
|||
Trash2,
|
||||
} from "lucide-react";
|
||||
import React, { useCallback, useRef, useState } from "react";
|
||||
import { useIsMobile } from "@/hooks/use-mobile";
|
||||
import { useDrag } from "react-dnd";
|
||||
import { getDocumentTypeIcon } from "@/app/dashboard/[search_space_id]/documents/(manage)/components/DocumentTypeIcon";
|
||||
import { ExportContextItems, ExportDropdownItems } from "@/components/shared/ExportMenuItems";
|
||||
|
|
@ -110,7 +109,6 @@ export const DocumentNode = React.memo(function DocumentNode({
|
|||
const [titleTooltipOpen, setTitleTooltipOpen] = useState(false);
|
||||
const rowRef = useRef<HTMLDivElement>(null);
|
||||
const titleRef = useRef<HTMLSpanElement>(null);
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
const handleExport = useCallback(
|
||||
(format: string) => {
|
||||
|
|
@ -122,17 +120,13 @@ export const DocumentNode = React.memo(function DocumentNode({
|
|||
[doc, onExport]
|
||||
);
|
||||
|
||||
const handleTitleTooltipOpenChange = useCallback(
|
||||
(open: boolean) => {
|
||||
if (isMobile) return;
|
||||
if (open && titleRef.current) {
|
||||
setTitleTooltipOpen(titleRef.current.scrollWidth > titleRef.current.clientWidth);
|
||||
} else {
|
||||
setTitleTooltipOpen(false);
|
||||
}
|
||||
},
|
||||
[isMobile]
|
||||
);
|
||||
const handleTitleTooltipOpenChange = useCallback((open: boolean) => {
|
||||
if (open && titleRef.current) {
|
||||
setTitleTooltipOpen(titleRef.current.scrollWidth > titleRef.current.clientWidth);
|
||||
} else {
|
||||
setTitleTooltipOpen(false);
|
||||
}
|
||||
}, []);
|
||||
|
||||
const attachRef = useCallback(
|
||||
(node: HTMLDivElement | null) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue