Add Basic Prompt image to UndrawCardComponent and create switch to select image
This commit is contained in:
parent
f31e601987
commit
69819fe59f
2 changed files with 18 additions and 1 deletions
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 9.8 KiB |
|
|
@ -3,6 +3,9 @@ import { useNavigate } from "react-router-dom";
|
||||||
/// <reference types="vite-plugin-svgr/client" />
|
/// <reference types="vite-plugin-svgr/client" />
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
import { ReactComponent as TransferFiles } from "../../assets/undraw_transfer_files_re_a2a9.svg"
|
import { ReactComponent as TransferFiles } from "../../assets/undraw_transfer_files_re_a2a9.svg"
|
||||||
|
//@ts-ignore
|
||||||
|
import { ReactComponent as BasicPrompt } from "../../assets/undraw_design_components_9vy6.svg"
|
||||||
|
|
||||||
import useFlowsManagerStore from "../../stores/flowsManagerStore";
|
import useFlowsManagerStore from "../../stores/flowsManagerStore";
|
||||||
import { FlowType } from "../../types/flow"
|
import { FlowType } from "../../types/flow"
|
||||||
import { updateIds } from "../../utils/reactflowUtils";
|
import { updateIds } from "../../utils/reactflowUtils";
|
||||||
|
|
@ -14,6 +17,18 @@ export default function UndrawCardComponent({
|
||||||
}: { flow: FlowType }) {
|
}: { flow: FlowType }) {
|
||||||
const addFlow = useFlowsManagerStore((state) => state.addFlow);
|
const addFlow = useFlowsManagerStore((state) => state.addFlow);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
function selectImage() {
|
||||||
|
switch (flow.name) {
|
||||||
|
case "Data Ingestion":
|
||||||
|
return <TransferFiles style={{ width: '80%', height: '80%', preserveAspectRatio: 'xMidYMid meet' }} />
|
||||||
|
case "Basic Prompting":
|
||||||
|
return <BasicPrompt style={{ width: '80%', height: '80%', preserveAspectRatio: 'xMidYMid meet' }} />
|
||||||
|
default:
|
||||||
|
return <TransferFiles style={{ width: '80%', height: '80%', preserveAspectRatio: 'xMidYMid meet' }} />
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card onClick={() => {
|
<Card onClick={() => {
|
||||||
updateIds(flow.data!);
|
updateIds(flow.data!);
|
||||||
|
|
@ -23,7 +38,8 @@ export default function UndrawCardComponent({
|
||||||
}} className="pt-4 w-80 h-72 cursor-pointer">
|
}} className="pt-4 w-80 h-72 cursor-pointer">
|
||||||
<CardContent className="w-full h-full">
|
<CardContent className="w-full h-full">
|
||||||
<div className="rounded-md border border-border bg-background w-full h-full flex flex-col items-center align-middle justify-center">
|
<div className="rounded-md border border-border bg-background w-full h-full flex flex-col items-center align-middle justify-center">
|
||||||
<TransferFiles style={{ width: '80%', height: '80%', preserveAspectRatio: 'xMidYMid meet' }} /> </div>
|
{selectImage()}
|
||||||
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
<CardDescription className="px-4 pb-4">
|
<CardDescription className="px-4 pb-4">
|
||||||
<CardTitle>{flow.name}</CardTitle>
|
<CardTitle>{flow.name}</CardTitle>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue