build mobile workspace flow

This commit is contained in:
sai karthik
2026-07-23 20:05:48 +05:30
parent 732c458fd4
commit 2aa7150716
35 changed files with 2552 additions and 217 deletions

View File

@@ -0,0 +1,35 @@
import type { FormEvent } from "react";
import { useState } from "react";
export const useMobileWorkspace = (initialExpanded = false) => {
const [activeIndex, setActiveIndex] = useState(0);
const [composerValue, setComposerValue] = useState("");
const [expanded, setExpanded] = useState(initialExpanded);
const [statusMessage, setStatusMessage] = useState<string>();
const handleComposerChange = (value: string) => {
setComposerValue(value);
setStatusMessage(undefined);
};
const handleComposerSubmit = (event: FormEvent<HTMLFormElement>) => {
event.preventDefault();
const message = composerValue.trim();
if (!message) {
return;
}
setComposerValue("");
setStatusMessage("Added to Zopus queue");
};
return {
activeIndex,
composerValue,
expanded,
handleActiveIndexChange: setActiveIndex,
handleComposerChange,
handleComposerSubmit,
setExpanded,
statusMessage,
};
};