Skip to content

Commit

Permalink
Add state and markdown components
Browse files Browse the repository at this point in the history
  • Loading branch information
leszekhanusz committed Mar 31, 2024
1 parent a06a8ad commit 27e8bc5
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions src/stores/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -858,21 +858,46 @@ export const useBackendStore = defineStore({
}
}
break;
case "state":
input = {
label: props.name,
id: "state_" + gradio_input.id,
default: "",
visible: false,
};
break;
case "markdown":
input = {
label: props.name,
id: "markdown_" + gradio_input.id,
default: "",
visible: false,
};
break;
default:
console.log("Unsupported gradio component type: ", gradio_input.type);
console.log("Unsupported gradio component type: ", gradio_input);

input = {
label: props.label,
id: "unsupported_" + gradio_input.id,
label: props.label !== undefined ? props.label : "undefined_label",
id:
"unsupported_" + gradio_input.id !== undefined
? gradio_input.id
: "no_id",
default: null,
visible: false,
};
break;
}

if (input.label === undefined) {
input.label = "undefined_label";
}

if (!("visible" in input)) {
input.visible = gradio_input.visible;
}

if (!("default" in input)) {
input.default = gradio_input.props.value;

Expand Down

0 comments on commit 27e8bc5

Please sign in to comment.