feat: initialize landing application with Vite and Mantine configuration

This commit is contained in:
Firman Ramdhani
2026-04-06 12:11:17 +07:00
parent 988826ac8e
commit 8c7b6d3017
16 changed files with 307 additions and 43 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
import { useState, useCallback } from 'react';
import { useIsElectron } from './use-is-electron';
// ─── Types ──────────────────────────────────────────────────────
@@ -50,7 +51,7 @@ export function useElectronPrinter(): UseElectronPrinterReturn {
const [loading, setLoading] = useState(false);
const [error, setError] = useState<string | null>(null);
const isElectron = typeof window !== 'undefined' && !!window.electronAPI;
const isElectron = useIsElectron();
const refreshPrinters = useCallback(async (): Promise<ElectronPrinterInfo[]> => {
if (!window.electronAPI) {
+2 -1
View File
@@ -1,4 +1,5 @@
import { useState, useEffect, useCallback } from 'react';
import { useIsElectron } from './use-is-electron';
// ─── Types ──────────────────────────────────────────────────────
@@ -64,7 +65,7 @@ export function useElectronUpdater(): UseElectronUpdaterReturn {
const [updateInfo, setUpdateInfo] = useState<ElectronUpdateInfo | null>(null);
const [errorMessage, setErrorMessage] = useState<string | null>(null);
const isElectron = typeof window !== 'undefined' && !!window.electronAPI;
const isElectron = useIsElectron();
useEffect(() => {
if (!window.electronAPI) return;
+7
View File
@@ -0,0 +1,7 @@
/**
* A utility hook to determine if the React application is running
* inside the Electron desktop wrapper or a standard web browser.
*/
export function useIsElectron(): boolean {
return typeof window !== 'undefined' && !!window.electronAPI;
}