mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 12:45:24 +02:00
Add tooltip preview on hover for notes in Pricing tab
Show note content in popup when hovering over the notes icon
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState, useMemo, useRef, useCallback } from 'react';
|
import React, { useState, useMemo, useRef, useCallback, useEffect } from 'react';
|
||||||
import { ExcelRow, COLUMNS } from '../types';
|
import { ExcelRow, COLUMNS } from '../types';
|
||||||
import {
|
import {
|
||||||
AlertTriangle,
|
AlertTriangle,
|
||||||
@@ -925,18 +925,24 @@ export function PricingView({ data, headers, onSaveRow, onCaptureState, onEdit,
|
|||||||
onChange={(e) => handleToggleCheck(dataIndex, e.target.checked)}
|
onChange={(e) => handleToggleCheck(dataIndex, e.target.checked)}
|
||||||
className="w-4 h-4 rounded border-slate-600 bg-slate-900 text-blue-600 focus:ring-blue-500 focus:ring-offset-slate-800 cursor-pointer"
|
className="w-4 h-4 rounded border-slate-600 bg-slate-900 text-blue-600 focus:ring-blue-500 focus:ring-offset-slate-800 cursor-pointer"
|
||||||
/>
|
/>
|
||||||
<button
|
<div className="relative group">
|
||||||
onClick={() => setNoteEditor({ rowIndex: dataIndex, text: note })}
|
<button
|
||||||
className={cn(
|
onClick={() => setNoteEditor({ rowIndex: dataIndex, text: note })}
|
||||||
"p-1.5 rounded-md transition-all shrink-0",
|
className={cn(
|
||||||
note
|
"p-1.5 rounded-md transition-all shrink-0",
|
||||||
? "bg-amber-500/10 text-amber-400 border border-amber-500/20 hover:bg-amber-500/20"
|
note
|
||||||
: "text-slate-500 hover:text-slate-300 hover:bg-slate-700/50"
|
? "bg-amber-500/10 text-amber-400 border border-amber-500/20 hover:bg-amber-500/20"
|
||||||
|
: "text-slate-500 hover:text-slate-300 hover:bg-slate-700/50"
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<MessageSquare className={cn("w-3.5 h-3.5", note && "fill-amber-400/20")} />
|
||||||
|
</button>
|
||||||
|
{note && (
|
||||||
|
<div className="absolute bottom-full left-1/2 -translate-x-1/2 mb-2 w-48 p-2 bg-amber-900/90 border border-amber-500/50 rounded text-xs text-white shadow-lg z-50 opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none">
|
||||||
|
{note}
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
title={note || "Add note"}
|
</div>
|
||||||
>
|
|
||||||
<MessageSquare className={cn("w-3.5 h-3.5", note && "fill-amber-400/20")} />
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user