chore: worker selector

This commit is contained in:
jialin
2025-10-21 15:59:48 +08:00
parent f017d609fb
commit 1e4018350f
10 changed files with 319 additions and 70 deletions
+25
View File
@@ -0,0 +1,25 @@
import React from 'react';
interface LabelSelectorContextProps {
options?: Array<{
label: string;
value: string | number;
children?: { label: string; value: string | number }[];
}>;
currentData?: Record<string, any>;
}
export const LabelSelectorContext =
React.createContext<LabelSelectorContextProps>(
{} as LabelSelectorContextProps
);
export const useLabelSelectorContext = () => {
const context = React.useContext(LabelSelectorContext);
if (!context) {
throw new Error(
'useLabelSelectorContext must be used within a LabelSelectorProvider'
);
}
return context;
};