This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { useState } from "preact/hooks";
|
||||
|
||||
interface PdfDownloadButtonProps {
|
||||
interface ResumeDownloadButtonProps {
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export default function PdfDownloadButton({
|
||||
export default function ResumeDownloadButton({
|
||||
className = "",
|
||||
}: PdfDownloadButtonProps) {
|
||||
}: ResumeDownloadButtonProps) {
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
@@ -15,7 +15,7 @@ export default function PdfDownloadButton({
|
||||
setError(null);
|
||||
|
||||
try {
|
||||
const response = await fetch("/api/resume/pdf");
|
||||
const response = await fetch(`/api/resume/pdf?t=${Date.now()}`);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(
|
||||
@@ -57,18 +57,7 @@ export default function PdfDownloadButton({
|
||||
Generating PDF...
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="1em"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
fill="currentColor"
|
||||
>
|
||||
<path d="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z" />
|
||||
</svg>
|
||||
Generate PDF Resume
|
||||
</>
|
||||
<>Download Resume</>
|
||||
)}
|
||||
</button>
|
||||
{error && <div class="mt-2 text-error text-sm">{error}</div>}
|
||||
Reference in New Issue
Block a user