@@ -4,10 +4,11 @@ import CardContent from '@mui/material/CardContent';
44import CardActions from '@mui/material/CardActions' ;
55import Button from '@mui/material/Button' ;
66import Typography from '@mui/material/Typography' ;
7+ import CardActionArea from '@mui/material/CardActionArea' ;
78
89const VaultCard = ( {
9- id, title, description, url, openLabel, editLabel,
10- deleteLabel, onClick, onEdit, onDelete,
10+ id, title, description, url, openLabel, editLabel, copyLabel ,
11+ deleteLabel, onClick, onEdit, onDelete, onCopy ,
1112} ) => {
1213 /**
1314 * Open the URL
@@ -30,18 +31,29 @@ const VaultCard = ({
3031 onDelete ( id ) ;
3132 } ;
3233
34+ /**
35+ * Copy the password to the clipboard
36+ */
37+ const copy = ( ) => {
38+ onCopy ( id ) ;
39+ } ;
40+
3341 return (
3442 < Card >
35- < CardContent >
36- < Typography variant = "h5" component = "div" >
37- { title }
38- </ Typography >
39- { description && description . length > 0 ? (
40- < Typography variant = "body2" >
41- { description }
43+ < CardActionArea
44+ onClick = { copy }
45+ >
46+ < CardContent >
47+ < Typography variant = "h5" component = "div" >
48+ { title }
4249 </ Typography >
43- ) : null }
44- </ CardContent >
50+ { description && description . length > 0 ? (
51+ < Typography variant = "body2" >
52+ { description }
53+ </ Typography >
54+ ) : null }
55+ </ CardContent >
56+ </ CardActionArea >
4557 < CardActions >
4658 { url && onClick ? (
4759 < Button
@@ -51,6 +63,12 @@ const VaultCard = ({
5163 { openLabel }
5264 </ Button >
5365 ) : null }
66+ < Button
67+ size = "small"
68+ onClick = { copy }
69+ >
70+ { copyLabel }
71+ </ Button >
5472 { onEdit ? (
5573 < Button
5674 size = "small"
0 commit comments