Skip to content

Commit

Permalink
skipped, completed init
Browse files Browse the repository at this point in the history
  • Loading branch information
ceddybi committed Feb 3, 2024
1 parent a185384 commit 915564a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 23 deletions.
36 changes: 13 additions & 23 deletions src/app/dashboard/index.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
import {
Bold,
Button,
Card,
Col,
Flex,
Grid,
List,
ListItem,
Metric,
Text,
Title,
} from "@tremor/react";
import { Bold, Button, Card, Flex, Grid, Metric, Text } from "@tremor/react";
import {
CheckCircleIcon,
QuestionMarkCircleIcon,
StopIcon,
UserGroupIcon,
UserIcon,
} from "@heroicons/react/20/solid";
import {
ProgressBar,
Expand All @@ -26,18 +12,17 @@ import {
TabPanel,
TabPanels,
} from "@tremor/react";
import { RenderQuestion, useQuestions } from "../questions/list";

import { LayoutPageProps } from "../layout";
import { QuestionAnswer } from "../questions/interfaces";
import QuestionsError from "./questions.error";
import React from "react";
import { TabExample } from "./tabs";
import { isEmpty } from "lodash";
import { useAppState } from "../hooks";
import { useQuestions } from "../questions/list";

export const Dashboard = ({ state }: LayoutPageProps) => {
const {
apps = [],
completedApps = [],
skippedApps = [],
isListRunning,
isAppRunning,
jobs = [],
Expand Down Expand Up @@ -163,10 +148,15 @@ export const Dashboard = ({ state }: LayoutPageProps) => {
<TabGroup>
<TabList className="mt-8">
<Tab icon={QuestionMarkCircleIcon}>
Questions: error ({errorQuestions.length})
Questions: error {errorQuestions.length && errorQuestions.length}
</Tab>
<Tab icon={StopIcon}>
Applications: skipped {skippedApps.length && skippedApps.length}
</Tab>
<Tab icon={CheckCircleIcon}>
Applications: completed{" "}
{completedApps.length && completedApps.length}
</Tab>
<Tab icon={StopIcon}>Applications: skipped</Tab>
<Tab icon={CheckCircleIcon}>Applications: completed</Tab>
</TabList>
<TabPanels>
<TabPanel>
Expand Down
3 changes: 3 additions & 0 deletions src/app/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { BEState } from "../utils/state";

export const useAppState = (): BEState => {
const [state, setState] = React.useState<BEState>({
apps: [],
completedApps: [],
skippedApps: [],
count: 0,
jobs: [],
applied: [],
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ async function runApplying(): Promise<any> {
if (firstJob) {
await setState({ ...state, activeJob: firstJob });
await gotoAppPage(firstJob);

await new Promise((resolve, reject) => {
setTimeout(() => {
resolve(true);
Expand Down

0 comments on commit 915564a

Please sign in to comment.