import React from "react";
import { useSettingsForm } from "./SettingsLayout";
import { FormField, FormItem, FormLabel, FormControl, FormDescription } from "@/components/ui/form";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
import { Switch } from "@/components/ui/switch";
import { ScrollArea } from "@/components/ui/scroll-area";
import { Badge } from "@/components/ui/badge";
import { Palette, Users } from "lucide-react";
import { fromSelectValue, toSelectValue } from "@/hooks/use-settings";
export function RolesSettings() {
const { form, meta } = useSettingsForm();
return (
System Roles
(
Student Role
Default role for new members/students.
)}
/>
(
Visitor Role
Role for visitors/guests.
)}
/>
Select roles that users can choose from to set their name color in the bot.
{meta?.roles.map((role) => (
{
const isSelected = field.value?.includes(role.id);
return (
{
return checked
? field.onChange([...(field.value || []), role.id])
: field.onChange(
field.value?.filter(
(value: string) => value !== role.id
)
)
}}
/>
{role.name}
)
}}
/>
))}
);
}