@@ -8,6 +8,7 @@ import DoneIcon from "@mui/icons-material/Done";
88import ErrorOutlineIcon from "@mui/icons-material/ErrorOutline" ;
99import ArrowBackIcon from "@mui/icons-material/ArrowBack" ;
1010import ArrowForwardIcon from "@mui/icons-material/ArrowForward" ;
11+ import ContentCopyIcon from "@mui/icons-material/ContentCopy" ;
1112import { Tooltip } from "@mui/material" ;
1213import InfoTooltip from "../../../common/InfoTooltip" ;
1314import Snackbar from "@mui/material/Snackbar" ;
@@ -128,6 +129,19 @@ function TimelineButtonGroup({
128129 backups [ 0 ] . question_cli_names ,
129130 backups [ 0 ] . unlock ,
130131 ) ;
132+
133+ const problemNames = useMemo ( ( ) => {
134+ const questionCliNames = backups [ 0 ] . question_cli_names ;
135+ const joined = questionCliNames . join ( ", " ) ;
136+ const unlockSuffix = backups [ 0 ] . unlock ? " (Unlocking)" : "" ;
137+
138+ if ( questionCliNames . length <= 1 ) {
139+ return "Problem " + joined + unlockSuffix ;
140+ } else {
141+ return "Problems " + joined + unlockSuffix ;
142+ }
143+ } , [ backups ] ) ;
144+
131145 const onClickCommand = ( ) => {
132146 copyOkpyCommand ( okpyCommand ) ;
133147 setIsSnackbarOpen ( true ) ;
@@ -137,15 +151,17 @@ function TimelineButtonGroup({
137151 < div >
138152 < div
139153 style = { {
140- whiteSpace : "pre-wrap" ,
141- fontFamily : "Menlo" ,
142- fontSize : "0.8rem" ,
143- cursor : "pointer" ,
154+ display : "flex" ,
155+ alignItems : "center" ,
144156 marginBottom : "0.5rem" ,
145157 } }
146- onClick = { onClickCommand }
147158 >
148- { okpyCommand }
159+ < Tooltip title = "Copy OkPy command" placement = "top" >
160+ < IconButton aria-label = "copy" onClick = { onClickCommand } size = "small" >
161+ < ContentCopyIcon />
162+ </ IconButton >
163+ </ Tooltip >
164+ < div > { problemNames } </ div >
149165 </ div >
150166
151167 < ButtonGroup
0 commit comments