|
@ -2,6 +2,7 @@ import React, { useState, useEffect } from "react" |
|
|
import { ButtonGroup, Button, Spacer, Input, useToasts } from "@geist-ui/core" |
|
|
import { ButtonGroup, Button, Spacer, Input, useToasts } from "@geist-ui/core" |
|
|
import PropTypes from "prop-types" |
|
|
import PropTypes from "prop-types" |
|
|
import { clockifyDataSet1 } from "../data/clockify_data1" |
|
|
import { clockifyDataSet1 } from "../data/clockify_data1" |
|
|
|
|
|
import { clockifyDataSet2 } from "../data/clockify_data2" |
|
|
|
|
|
|
|
|
export var fileContent = "{}" |
|
|
export var fileContent = "{}" |
|
|
var uploadFailed = false |
|
|
var uploadFailed = false |
|
@ -24,6 +25,12 @@ function SingleFileUpload({ onFileUploaded }) { |
|
|
setFileUploaded(true) |
|
|
setFileUploaded(true) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const loadSecondDataSet = () => { |
|
|
|
|
|
fileContent = clockifyDataSet2 |
|
|
|
|
|
uploadFailed = false |
|
|
|
|
|
setFileUploaded(true) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
if (fileUploaded) { |
|
|
if (fileUploaded) { |
|
|
onFileUploaded() |
|
|
onFileUploaded() |
|
@ -83,6 +90,7 @@ function SingleFileUpload({ onFileUploaded }) { |
|
|
<Spacer h={2} /> |
|
|
<Spacer h={2} /> |
|
|
<ButtonGroup> |
|
|
<ButtonGroup> |
|
|
<Button onClick={loadFirstDataSet}>Data Set 1 (26/09/23 - 30/01/24)</Button> |
|
|
<Button onClick={loadFirstDataSet}>Data Set 1 (26/09/23 - 30/01/24)</Button> |
|
|
|
|
|
<Button onClick={loadSecondDataSet}>Data Set 2 (SSVT-Combined) (26/09/23 - 30/01/24)</Button> |
|
|
</ButtonGroup> |
|
|
</ButtonGroup> |
|
|
</div> |
|
|
</div> |
|
|
) |
|
|
) |
|
|