-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy pathSessionBox.jsx
More file actions
62 lines (61 loc) · 1.46 KB
/
Copy pathSessionBox.jsx
File metadata and controls
62 lines (61 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import React from "react";
import { Box, Typography } from "@mui/material";
import SessionMenu from "./SessionMenu";
export default function SessionBox({
isSelected,
name,
modelName,
id,
onClick,
onDelete,
onInfo,
}) {
return (
<Box
sx={{
width: "100%",
height: "50px",
display: "flex",
justifyContent: "space-between",
alignItems: "center",
borderRadius: 1,
cursor: isSelected ? "default" : "pointer",
bgcolor: isSelected ? "action.selected" : "transparent",
p: 0.5,
"&:hover": {
backgroundColor: isSelected ? "action.selected" : "action.hover",
},
}}
onClick={isSelected ? undefined : onClick}
>
<Box
sx={{
display: "flex",
alignItems: "center",
justifyContent: "flex-start",
width: "100%",
}}
>
<Box>
<Typography
variant="body2"
color="text.primary"
noWrap
sx={{ maxWidth: 180, fontSize: 14 }}
>
{name ? name : "Untitled Session"}
</Typography>
<Typography
variant="caption"
color="text.secondary"
noWrap
sx={{ maxWidth: 150, fontSize: 10, pl: 1 }}
>
{modelName}
</Typography>
</Box>
</Box>
<SessionMenu sessionId={id} onInfo={onInfo} onDelete={onDelete} />
</Box>
);
}