"use client"; import { FormField, FormItem, FormLabel, FormControl, FormDescription, FormMessage } from "@app/components/ui/form"; import { SwitchInput } from "@app/components/SwitchInput"; import { RadioGroup, RadioGroupItem } from "@app/components/ui/radio-group"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@app/components/ui/select"; import { Input } from "@app/components/ui/input"; import { useTranslations } from "next-intl"; import { Control, FieldValues, Path } from "react-hook-form"; type Role = { roleId: number; name: string; }; type AutoProvisionConfigWidgetProps = { control: Control; autoProvision: boolean; onAutoProvisionChange: (checked: boolean) => void; roleMappingMode: "role" | "expression"; onRoleMappingModeChange: (mode: "role" | "expression") => void; roles: Role[]; roleIdFieldName: Path; roleMappingFieldName: Path; }; export default function AutoProvisionConfigWidget({ control, autoProvision, onAutoProvisionChange, roleMappingMode, onRoleMappingModeChange, roles, roleIdFieldName, roleMappingFieldName }: AutoProvisionConfigWidgetProps) { const t = useTranslations(); return (
{t("idpAutoProvisionUsersDescription")}
{autoProvision && (
{t("roleMapping")} {t("roleMappingDescription")}
{roleMappingMode === "role" ? ( ( {t("selectRoleDescription")} )} /> ) : ( ( {t("roleMappingExpressionDescription")} )} /> )}
)}
); }