mirror of
https://github.com/skidoodle/hostinfo
synced 2025-03-16 13:59:38 +01:00
first commit
This commit is contained in:
commit
38e6f714cb
26 changed files with 1856 additions and 0 deletions
29
entrypoints/popup/Popup.tsx
Normal file
29
entrypoints/popup/Popup.tsx
Normal file
|
@ -0,0 +1,29 @@
|
|||
import { Spinner } from '@/components/Spinner';
|
||||
import ServerInfo from '@/components/ServerInfo';
|
||||
import Error from '@/components/Error';
|
||||
|
||||
export default function Popup() {
|
||||
const { data, loading, error } = useTabData();
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
<div className="flex items-center justify-center h-48 bg-gray-900">
|
||||
<Spinner className="w-12 h-12 text-purple-500" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (error) {
|
||||
return (
|
||||
<Error error={error} />
|
||||
);
|
||||
}
|
||||
|
||||
if (!data) {
|
||||
return (
|
||||
<Error error="No data found" />
|
||||
);
|
||||
}
|
||||
|
||||
return <ServerInfo data={data} />;
|
||||
}
|
13
entrypoints/popup/index.html
Normal file
13
entrypoints/popup/index.html
Normal file
|
@ -0,0 +1,13 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>hostinfo</title>
|
||||
<meta name="manifest.type" content="browser_action" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="./main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
10
entrypoints/popup/main.tsx
Normal file
10
entrypoints/popup/main.tsx
Normal file
|
@ -0,0 +1,10 @@
|
|||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import Popup from '@/entrypoints/popup/Popup';
|
||||
import '@/assets/tailwind.css';
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root')!).render(
|
||||
<React.StrictMode>
|
||||
<Popup />
|
||||
</React.StrictMode>,
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue