Skip to content

Commit 4586348

Browse files
committed
refactor: example PDF
1 parent a196db3 commit 4586348

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/components/ProcessingSteps.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ interface ProcessingStepsProps {
1111
onDetect: () => void;
1212
}
1313

14-
const EXAMPLE_PDF_URL =
15-
"https://us-beautiful-space.nyc3.digitaloceanspaces.com/commonforms/cerfa_14571-05_LONG_SEJOUR_EN.pdf";
16-
const EXAMPLE_PDF_FILENAME = "cerfa_14571-05_LONG_SEJOUR_EN.pdf";
14+
const EXAMPLE_PDF = {
15+
URL: "https://us-beautiful-space.nyc3.digitaloceanspaces.com/commonforms/cerfa_14571-05_LONG_SEJOUR_EN.pdf",
16+
FILENAME: "cerfa_14571-05_LONG_SEJOUR_EN.pdf",
17+
};
1718

1819
export const ProcessingSteps = ({
1920
pdfFile,
@@ -40,15 +41,15 @@ export const ProcessingSteps = ({
4041

4142
const handleLoadExample = useCallback(async () => {
4243
try {
43-
const fetchResponse = await fetch(EXAMPLE_PDF_URL);
44+
const fetchResponse = await fetch(EXAMPLE_PDF.URL);
4445

4546
if (!fetchResponse.ok) {
4647
console.error("Failed to fetch example PDF:", fetchResponse.statusText);
4748
return;
4849
}
4950

5051
const pdfBlob = await fetchResponse.blob();
51-
const exampleFile = new File([pdfBlob], EXAMPLE_PDF_FILENAME, {
52+
const exampleFile = new File([pdfBlob], EXAMPLE_PDF.FILENAME, {
5253
type: "application/pdf",
5354
});
5455

0 commit comments

Comments
 (0)