make working on github pages

This commit is contained in:
Leo Wen
2025-02-07 22:51:10 -08:00
parent 77a95521f9
commit a1249bc96f
+7 -2
View File
@@ -10,10 +10,15 @@ interface PreviewButtonProps {
const PreviewButton = ({ fileName }: PreviewButtonProps) => { const PreviewButton = ({ fileName }: PreviewButtonProps) => {
const handlePreview = () => {
const url = `/view/${encodeURIComponent(fileName)}`;
window.open(url, '_blank');
};
return ( return (
<Link to={`/view/${encodeURIComponent(fileName)}`} target="_blank" className="bg-blue-500 text-white px-2 py-1 rounded"> <button className="bg-blue-500 text-white px-2 py-1 rounded" onClick={handlePreview}>
Preview Preview
</Link> </button>
); );
}; };