Let's walk through it.
@@ -101,15 +106,23 @@ const ConfigureImage = () => {
});
const stepSignal = useStepper();
- // TODO: push values to the parent form Store
+ const [store, set] = getStepStore(stepSignal);
+
const handleSubmit: SubmitHandler = (values, event) => {
- console.log("ISO creation submitted", values);
- // Here you would typically trigger the ISO creation process
+ // Push values to the store
+ set("flash", (s) => ({
+ ...s,
+ language: values.language,
+ keymap: values.keymap,
+ ssh_file: values.ssh_key,
+ }));
+
stepSignal.next();
};
+ const client = useApiClient();
const onSelectFile = async () => {
- const req = callApi("get_system_file", {
+ const req = client.fetch("get_system_file", {
file_request: {
mode: "select_folder",
title: "Select a folder for you new Clan",
@@ -131,6 +144,9 @@ const ConfigureImage = () => {
throw new Error("No data returned from api call");
};
+ const currClan = useClanURI();
+ const optionsQuery = useMachineFlashOptions(currClan);
+
return (