Move request to another workspace (#52)

This commit is contained in:
Gregory Schier
2024-06-21 09:01:18 -07:00
committed by GitHub
parent dc5dfeb022
commit 50e2ab3a03
19 changed files with 253 additions and 77 deletions

View File

@@ -46,14 +46,7 @@ export const DialogProvider = ({ children }: { children: React.ReactNode }) => {
actions,
};
return (
<DialogContext.Provider value={state}>
{children}
{dialogs.map((props: DialogEntry) => (
<DialogInstance key={props.id} {...props} />
))}
</DialogContext.Provider>
);
return <DialogContext.Provider value={state}>{children}</DialogContext.Provider>;
};
function DialogInstance({ id, render, ...props }: DialogEntry) {
@@ -67,3 +60,14 @@ function DialogInstance({ id, render, ...props }: DialogEntry) {
}
export const useDialog = () => useContext(DialogContext).actions;
export function Dialogs() {
const { dialogs } = useContext(DialogContext);
return (
<>
{dialogs.map((props: DialogEntry) => (
<DialogInstance key={props.id} {...props} />
))}
</>
);
}