mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-10 20:11:49 +00:00
Merge branch 'feature/mvp' of https://github.com/storytold/storyteller-frontend into feature/mvp
This commit is contained in:
commit
c540453761
1 file changed
+18
-13
+18
-13
@@ -1,8 +1,10 @@
|
||||
import React, { useState } from "react";
|
||||
import React, {
|
||||
// useState
|
||||
} from "react";
|
||||
import InferenceJobsList from "components/layout/InferenceJobsList";
|
||||
import { FrontendInferenceJobType } from "@storyteller/components/src/jobs/InferenceJob";
|
||||
import { TempSelect } from "components/common";
|
||||
import { enumToKeyArr } from "resources";
|
||||
// import { TempSelect } from "components/common";
|
||||
// import { enumToKeyArr } from "resources";
|
||||
import ModalHeader from "../ModalHeader";
|
||||
|
||||
interface Props {
|
||||
@@ -11,15 +13,15 @@ interface Props {
|
||||
}
|
||||
|
||||
export default function InferenceJobsModal({ handleClose, jobType: inJobType = -1 }: Props) {
|
||||
const presetFilter = enumToKeyArr(FrontendInferenceJobType)[inJobType];
|
||||
const [jobType,jobTypeSet] = useState(inJobType > -1 ? presetFilter : "All");
|
||||
const typeObj = ["All", ...Object.values(FrontendInferenceJobType)];
|
||||
// const presetFilter = enumToKeyArr(FrontendInferenceJobType)[inJobType];
|
||||
// const [jobType,jobTypeSet] = useState(inJobType > -1 ? presetFilter : "All");
|
||||
// const typeObj = ["All", ...Object.values(FrontendInferenceJobType)];
|
||||
|
||||
const options = typeObj.filter(val => isNaN(Number(val)))
|
||||
.map((value) => {
|
||||
if (typeof value === "string") return { value, label: value }
|
||||
return { label: "", value: "" };
|
||||
});
|
||||
// const options = typeObj.filter(val => isNaN(Number(val)))
|
||||
// .map((value) => {
|
||||
// if (typeof value === "string") return { value, label: value }
|
||||
// return { label: "", value: "" };
|
||||
// });
|
||||
|
||||
const failures = (fail = "") => {
|
||||
switch (fail) {
|
||||
@@ -30,10 +32,13 @@ export default function InferenceJobsModal({ handleClose, jobType: inJobType = -
|
||||
|
||||
return <>
|
||||
<ModalHeader {...{ handleClose, title: "My Jobs" }} />
|
||||
<TempSelect {...{ onChange: ({ target }: { target: any }) => jobTypeSet(target.value), options, value: jobType }} />
|
||||
{
|
||||
// <TempSelect {...{ onChange: ({ target }: { target: any }) => jobTypeSet(target.value), options, value: jobType }} />
|
||||
}
|
||||
<InferenceJobsList {...{
|
||||
failures,
|
||||
value: typeObj.indexOf(jobType),
|
||||
value: 0 // fixed for now
|
||||
// value: typeObj.indexOf(jobType),
|
||||
}} />
|
||||
</>;
|
||||
};
|
||||
Reference in new issue
Block a user