Added tab switch on Issue click
This commit is contained in:
@@ -368,6 +368,7 @@ export default function DeviceDetail() {
|
||||
const notesRef = useRef(null);
|
||||
const [usersLoading, setUsersLoading] = useState(false);
|
||||
const [unresolvedIssues, setUnresolvedIssues] = useState(0);
|
||||
const [notesPanelTab, setNotesPanelTab] = useState(null);
|
||||
const notesPanelRef = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -954,7 +955,7 @@ export default function DeviceDetail() {
|
||||
</SectionCard>
|
||||
);
|
||||
|
||||
const notesSection = <div ref={notesPanelRef}><NotesPanel deviceId={id} /></div>;
|
||||
const notesSection = <div ref={notesPanelRef}><NotesPanel deviceId={id} initialTab={notesPanelTab} /></div>;
|
||||
const logsSection = <DeviceLogsPanel deviceSerial={device.device_id} />;
|
||||
|
||||
// ===== Layout rendering =====
|
||||
@@ -1054,7 +1055,7 @@ export default function DeviceDetail() {
|
||||
<>
|
||||
<div style={{ width: 1, height: 24, backgroundColor: "var(--border-primary)" }} />
|
||||
<button
|
||||
onClick={() => notesPanelRef.current?.scrollIntoView({ behavior: "smooth", block: "start" })}
|
||||
onClick={() => { setNotesPanelTab("issues"); notesPanelRef.current?.scrollIntoView({ behavior: "smooth", block: "start" }); }}
|
||||
className="flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded-md cursor-pointer hover:opacity-80 transition-opacity"
|
||||
style={{ backgroundColor: "var(--danger-bg)", color: "var(--danger-text)", border: "none" }}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user