mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-04-24 03:00:09 -04:00
34 lines
712 B
TypeScript
34 lines
712 B
TypeScript
export type RoleMap = {
|
|
[category: string]: CategoryOption;
|
|
};
|
|
|
|
export type RoleOption = {
|
|
value: string;
|
|
label: string;
|
|
};
|
|
|
|
export type CategoryOption = {
|
|
label: string;
|
|
options: Array<RoleOption>;
|
|
};
|
|
|
|
// export const parseRoles = (
|
|
// roles: Array<PlayerRole>,
|
|
// ): Array<CategoryOption> => {
|
|
// const rolesMap: RoleMap = {};
|
|
// roles.forEach((role) => {
|
|
// if (!(role.category in rolesMap)) {
|
|
// rolesMap[role.category] = {
|
|
// label: role.category,
|
|
// options: [],
|
|
// };
|
|
// }
|
|
// rolesMap[role.category].options?.push({
|
|
// value: role.id,
|
|
// label: role.name,
|
|
// ...role,
|
|
// });
|
|
// });
|
|
// return Object.values(rolesMap);
|
|
// };
|