Commit completed Torbat Pages admin frontend module, BFF proxy, routes, and validation artifacts for official platform deploy. Co-authored-by: Cursor <cursoragent@cursor.com>
28 lines
852 B
TypeScript
28 lines
852 B
TypeScript
"use client";
|
|
|
|
import { useExperienceWorkspace } from "@/modules/experience/hooks/useExperienceWorkspace";
|
|
import { Select, FormField } from "@/components/ds";
|
|
import { ExperienceSkeleton } from "@/modules/experience/design-system";
|
|
|
|
export function WorkspaceSwitcher() {
|
|
const { workspaces, workspaceId, setWorkspaceId, isLoading } = useExperienceWorkspace();
|
|
|
|
if (isLoading) return <ExperienceSkeleton rows={1} />;
|
|
|
|
return (
|
|
<FormField label="فضای کاری">
|
|
<Select
|
|
value={workspaceId ?? ""}
|
|
onChange={(e) => setWorkspaceId(e.target.value)}
|
|
className="min-w-[180px]"
|
|
>
|
|
{workspaces.map((w) => (
|
|
<option key={String(w.id)} value={String(w.id)}>
|
|
{String(w.name ?? w.code)}
|
|
</option>
|
|
))}
|
|
</Select>
|
|
</FormField>
|
|
);
|
|
}
|