Skip to content

Commit 40ba074

Browse files
committed
feat: fail to fix download button
1 parent 2592c7c commit 40ba074

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

central-das-imagens-front/src/components/card-photo/card-photo.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function CardPhoto (props) {
5757
// Crie um link temporário para o download
5858
const link = document.createElement('a');
5959
link.href = props.foto;
60-
link.download = 'minha-foto.jpg'; // Nome do arquivo para download
60+
link.download = props.imagem; // Nome do arquivo para download
6161
link.click();
6262
}
6363

@@ -68,7 +68,7 @@ function CardPhoto (props) {
6868
<h3>{props.titulo}</h3>
6969
<p>{props.descricao}</p>
7070
<div className="botoes-container">
71-
<Button color="#69FFF1" size="100%" onClick={handleDownload}> <FaDownload /> <a download="filename" href={props.foto} >Baixar</a> </Button>
71+
<Button color="#69FFF1" size="100%" onClick={handleDownload}><FaDownload/> <a download="filename" href={props.imagem}>Baixar</a></Button>
7272
{user && user.name === "admin" && (
7373
<div className="botoes">
7474
<Button color="#99C24D"> <Link className="link-" to={`/atualizar/${props.id}`}> <BsPencilSquare /> Editar</Link> </Button>

0 commit comments

Comments
 (0)