summaryrefslogtreecommitdiff
path: root/lib/admin-users/table
diff options
context:
space:
mode:
Diffstat (limited to 'lib/admin-users/table')
-rw-r--r--lib/admin-users/table/add-ausers-dialog.tsx32
1 files changed, 29 insertions, 3 deletions
diff --git a/lib/admin-users/table/add-ausers-dialog.tsx b/lib/admin-users/table/add-ausers-dialog.tsx
index 5c6e600a..6c6a1e99 100644
--- a/lib/admin-users/table/add-ausers-dialog.tsx
+++ b/lib/admin-users/table/add-ausers-dialog.tsx
@@ -50,6 +50,7 @@ import { toast } from "sonner"
import { Vendor } from "@/db/schema/vendors"
import { FormDescription } from "@/components/ui/form"
import { ScrollArea } from "@/components/ui/scroll-area"
+import { Switch } from "@/components/ui/switch"
// i18n-iso-countries import
import i18nIsoCountries from "i18n-iso-countries"
@@ -126,7 +127,7 @@ export function AddUserDialog() {
}, [])
// react-hook-form 세팅
- const form = useForm<CreateUserSchema & { language?: string; phone?: string }>({
+ const form = useForm<CreateUserSchema & { language?: string; phone?: string; country?: string }>({
resolver: zodResolver(createUserSchema),
defaultValues: {
name: "",
@@ -136,7 +137,9 @@ export function AddUserDialog() {
language:'en',
// roles는 array<string>, 여기서는 단일 선택 시 [role]로 담음
roles: ["Vendor Admin"],
- domain:'partners'
+ domain:'partners',
+ isActive: true, // 기본값 활성화
+ country: undefined, // 국가 필드
// domain, etc. 필요하다면 추가
},
})
@@ -177,7 +180,7 @@ export function AddUserDialog() {
</Button>
</DialogTrigger>
- <DialogContent>
+ <DialogContent className="max-w-2xl max-h-[90vh] overflow-y-auto">
<DialogHeader>
<DialogTitle>Create New User</DialogTitle>
<DialogDescription>
@@ -450,6 +453,29 @@ export function AddUserDialog() {
)}
/>
+ {/* 활성화 상태 */}
+ <FormField
+ control={form.control}
+ name="isActive"
+ render={({ field }) => (
+ <FormItem className="flex flex-row items-center justify-between rounded-lg border p-3">
+ <div className="space-y-0.5">
+ <FormLabel>Account Status</FormLabel>
+ <FormDescription className="text-xs text-muted-foreground">
+ 활성화된 계정만 로그인할 수 있습니다.
+ </FormDescription>
+ </div>
+ <FormControl>
+ <Switch
+ checked={field.value}
+ onCheckedChange={field.onChange}
+ />
+ </FormControl>
+ <FormMessage />
+ </FormItem>
+ )}
+ />
+
</div>
<DialogFooter>