1- import { useContext , useState } from "react" ;
1+ import { useContext } from "react" ;
22import classNames from "classnames" ;
33import { GearIcon } from "@radix-ui/react-icons" ;
4- import {
5- DeploymentEventContent ,
6- ActionText ,
7- } from "@common/elements/DeploymentEventContent" ;
4+ import { ActionText } from "@common/elements/DeploymentEventContent" ;
85import { ITEM_SIZE } from "@common/features/logs/components/LogListItem" ;
96import { formatDateTime } from "@common/lib/format" ;
107import { DeploymentAuditLogEvent } from "@common/lib/useDeploymentAuditLog" ;
11- import { DetailPanel } from "@common/elements/DetailPanel" ;
128import { DeploymentInfoContext } from "@common/lib/deploymentContext" ;
139
1410export function DeploymentEventListItem ( {
@@ -17,34 +13,19 @@ export function DeploymentEventListItem({
1713 focused = false ,
1814 hitBoundary,
1915 setShownLog,
20- onCloseDialog,
21- newLogsPageSidepanel,
2216 logKey,
2317} : {
2418 event : DeploymentAuditLogEvent ;
2519 inline ?: boolean ;
2620 focused ?: boolean ;
2721 hitBoundary ?: "top" | "bottom" | null ;
2822 setShownLog ?: ( ) => void ;
29- onCloseDialog ?: ( ) => void ;
30- newLogsPageSidepanel ?: boolean ;
3123 logKey ?: string ;
3224} ) {
3325 const { TeamMemberLink } = useContext ( DeploymentInfoContext ) ;
34- const [ showDetails , setShowDetails ] = useState ( false ) ;
3526 const timestamp = formatDateTime ( new Date ( event . _creationTime ) ) ;
3627
37- // When the button receives focus and setShownLog is available, call it
38- const handleFocus = ( ) => {
39- if ( setShownLog ) {
40- setShownLog ( ) ;
41- }
42- } ;
43-
4428 const handleClick = ( ) => {
45- if ( ! newLogsPageSidepanel ) {
46- setShowDetails ( true ) ;
47- }
4829 if ( setShownLog ) {
4930 setShownLog ( ) ;
5031 }
@@ -77,7 +58,7 @@ export function DeploymentEventListItem({
7758 height : ITEM_SIZE ,
7859 } }
7960 onClick = { handleClick }
80- onFocus = { handleFocus }
61+ onFocus = { handleClick }
8162 tabIndex = { setShownLog ? 0 : - 1 }
8263 >
8364 < div className = "min-w-[9.25rem] text-left font-mono whitespace-nowrap text-content-primary" >
@@ -105,17 +86,6 @@ export function DeploymentEventListItem({
10586 </ span >
10687 </ div >
10788 </ button >
108-
109- { showDetails && (
110- < DetailPanel
111- onClose = { ( ) => {
112- setShowDetails ( false ) ;
113- onCloseDialog ?.( ) ;
114- } }
115- header = "Deployment Event"
116- content = { < DeploymentEventContent event = { event } /> }
117- />
118- ) }
11989 </ div >
12090 ) ;
12191}
0 commit comments