From babaaa631d8c3a46be3b9fe23e643b971333937b Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Sun, 26 Oct 2025 14:47:50 -0700 Subject: generalize eamusement userscript method into 1 template modal --- .../modals/EamusementUserscriptModal.tsx | 172 +++++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 frontend/src/components/modals/EamusementUserscriptModal.tsx (limited to 'frontend/src/components/modals/EamusementUserscriptModal.tsx') diff --git a/frontend/src/components/modals/EamusementUserscriptModal.tsx b/frontend/src/components/modals/EamusementUserscriptModal.tsx new file mode 100644 index 0000000..d7dc03a --- /dev/null +++ b/frontend/src/components/modals/EamusementUserscriptModal.tsx @@ -0,0 +1,172 @@ +interface UserScript { + name: string; + url: string; +} + +interface EamusementUserscriptModalProps { + isOpen: boolean; + onClose: () => void; + mainGameName: string; + userPage: string; + importPage: string; + scripts: UserScript[]; +} + +interface EamusementUserscriptCardProps { + mainGameName: string; + onClick: () => void; +} + +export const EamusementUserscriptCard = ({ mainGameName, onClick }: EamusementUserscriptCardProps) => { + return ( +
+
+ + + +
+

+ {mainGameName} e-amusement Play History (Userscript) +

+

+ Import via scraping your {mainGameName} playdata from KONAMI e-amusement +

+ +
+ ) +} + +const EamusementUserscriptModal = ({ + isOpen, + onClose, + mainGameName, + userPage, + importPage, + scripts, +}: EamusementUserscriptModalProps) => { + if (!isOpen) return null; + + const handleClose = () => { + onClose(); + }; + if(mainGameName === undefined){ + return "Sorry, due to some extreme error the game you're looking for doesn't seem to exist..." + } + return ( +
+ {/* Backdrop */} +
+ + {/* Modal */} +
+
+ {/* Header */} +
+

+ Import {mainGameName} e-amusement Data +

+

+ Follow the instructions below to import your data +

+
+ + {/* Warning */} +
+

+ You may or may need to be subscribed to{" "} + + KONAMI's e-amusement Basic and/or Premium course + {" "} + to view a exportable playdata history for certain games. +

+
+ + {/* Instructions */} +
+

+ Instructions: +

+
    +
  1. + Log into the{" "} + + {mainGameName} e-amusement page + +
  2. +
  3. + Navigate to the{" "} + + {mainGameName} Play History Page + {" "} +
  4. +
  5. + Install the relevant userscript (use a browser extension such as{" "} + Tampermonkey) +
  6. + {/* Additional Info */} +
    +

    + {scripts.map(userscript => ( + + {userscript.name} + + ))} +

    +
    +
  7. + A button will appear on the page that you can click to start the scraping process. +
  8. +
  9. + Upload the resulting JSON file into Mirage using the + Batch-Manual Upload functionality +
  10. +
  11. Verify that all data has been imported correctly
  12. +
+
+ + {/* Actions */} +
+ +
+
+
+
+ ); +}; + +export default EamusementUserscriptModal; -- cgit v1.2.3