added details drawer

This commit is contained in:
daniel31x13
2024-08-18 02:55:59 -04:00
parent a40026040c
commit c18a5f4162
25 changed files with 881 additions and 310 deletions
+36
View File
@@ -0,0 +1,36 @@
import React from "react";
type Props = {
text: string;
};
const CopyButton = ({ text }: Props) => {
return (
<div
className="bi-copy text-xl text-neutral btn btn-sm btn-square btn-ghost"
onClick={() => {
try {
navigator.clipboard.writeText(text).then(() => {
const copyIcon = document.querySelector(".bi-copy");
if (copyIcon) {
copyIcon.classList.remove("bi-copy");
copyIcon.classList.add("bi-check2");
copyIcon.classList.add("text-success");
}
setTimeout(() => {
if (copyIcon) {
copyIcon.classList.remove("bi-check2");
copyIcon.classList.remove("text-success");
copyIcon.classList.add("bi-copy");
}
}, 1000);
});
} catch (err) {
console.log(err);
}
}}
></div>
);
};
export default CopyButton;