-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
207 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,77 @@ | ||
import { | ||
Bold, | ||
Button, | ||
Card, | ||
Col, | ||
Flex, | ||
Grid, | ||
Metric, | ||
Text, | ||
} from "@tremor/react"; | ||
|
||
import React from "react"; | ||
import { useAppState } from "../hooks"; | ||
|
||
export const Dashboard = () => { | ||
return <div>Dashboard</div>; | ||
const state = useAppState(); | ||
const { isListRunning, isAppRunning } = state; | ||
|
||
const toggleStartStop = async (eventName: string) => { | ||
const startStop = `${eventName}:${isListRunning ? "stop" : "start"}`; | ||
await (window as any).api.invoke(startStop, null); | ||
}; | ||
|
||
const allEvents = [ | ||
{ title: "Main", name: "list", isRunning: isListRunning }, | ||
{ title: "App", name: "app", isRunning: isAppRunning }, | ||
]; | ||
|
||
return ( | ||
<Grid numItems={1} numItemsSm={2} numItemsLg={2} className="gap-3"> | ||
{allEvents.map(({ isRunning, name: eventName, title }) => { | ||
return ( | ||
<Card key={eventName}> | ||
<div className="flex items-center"> | ||
<Metric>{title}</Metric> | ||
<div className="p-3"> | ||
<Bold> some nice number </Bold> | ||
</div> | ||
</div> | ||
|
||
<div className="flex justify-center"> | ||
<Button | ||
onClick={() => toggleStartStop(eventName)} | ||
disabled={isRunning} | ||
loading={isRunning} | ||
> | ||
{" "} | ||
{!isListRunning ? "Run" : "Running"}{" "} | ||
</Button> | ||
|
||
<div className="ml-2"> | ||
{isListRunning && ( | ||
<Button | ||
color="red" | ||
onClick={() => toggleStartStop(eventName)} | ||
> | ||
{" "} | ||
Stop{" "} | ||
</Button> | ||
)} | ||
</div> | ||
</div> | ||
</Card> | ||
); | ||
})} | ||
|
||
{/* Analytics */} | ||
{/* <Col numColSpan={3}> | ||
<Card> | ||
<Text>Title</Text> | ||
</Card> | ||
</Col> */} | ||
</Grid> | ||
); | ||
}; | ||
|
||
export default Dashboard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from "react"; | ||
import { Textarea } from "@tremor/react"; | ||
|
||
export const ResumePage = () => { | ||
return ( | ||
<div> | ||
<Textarea rows={100} placeholder="Resume" /> | ||
<div className="flex justify-center mt-2 mb-2"> | ||
<button className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"> | ||
Save | ||
</button> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ResumePage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters