diff --git a/src/components/form/RankRolesField.jsx b/src/components/form/RankRolesField.jsx index 76734bb..9a4bb80 100644 --- a/src/components/form/RankRolesField.jsx +++ b/src/components/form/RankRolesField.jsx @@ -1,4 +1,5 @@ import { Controller, useWatch } from 'react-hook-form'; +import Select from 'react-select'; import { Button, Form, Table } from 'react-bootstrap'; function patchRow(rows, index, patch) { @@ -8,11 +9,12 @@ function patchRow(rows, index, patch) { } function emptyRow() { - return { title: '', role: '', limit: 10, sort_order: 0, view_mode: 'versus', scope: 'domain', show_as: 'user', highlight_count: 0, highlight_color: '' }; + return { title: '', role: '', limit: 10, sort_order: 0, view_mode: 'versus', scope: 'domain', show_as: 'user', highlight_count: 0, highlight_color: '', visible_roles: [] }; } export default function RankRolesField({ field, control }) { const roles = field.roles || {}; + const roleOptions = Object.entries(roles).map(([value, label]) => ({ value, label })); const isTeam = useWatch({ control, name: 'leaderboard_roles_type' }) === 'team'; return ( What to show : null} {isTeam ? Show : null} Limit + Visible Roles Highlight Color Sort Order @@ -110,6 +113,19 @@ export default function RankRolesField({ field, control }) { onChange={(e) => rhf.onChange(patchRow(rows, index, { limit: e.target.value }))} /> + +