import { useMutation } from "@tanstack/react-query"; import type { AxiosError } from "axios"; import { Building2, Sparkles } from "lucide-react"; import { useState } from "react"; import { useNavigate } from "react-router-dom"; import { Badge } from "../../../components/ui/badge"; import { Button } from "../../../components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "../../../components/ui/card"; import { Input } from "../../../components/ui/input"; import { Label } from "../../../components/ui/label"; import { Textarea } from "../../../components/ui/textarea"; import { createTenant } from "../../../lib/adminApi"; function TenantCreatePage() { const navigate = useNavigate(); const [name, setName] = useState(""); const [slug, setSlug] = useState(""); const [description, setDescription] = useState(""); const [status, setStatus] = useState("active"); const mutation = useMutation({ mutationFn: () => createTenant({ name, slug: slug || undefined, description: description || undefined, status, }), onSuccess: () => { navigate("/tenants"); }, }); const errorMsg = (mutation.error as AxiosError<{ error?: string }>)?.response ?.data?.error; return (
Tenants / Create

테넌트 추가

글로벌 운영 기준의 신규 테넌트를 등록합니다.

Admin only
Tenant Profile 필수 정보만 입력해도 생성 가능합니다. Slug는 없으면 자동 생성됩니다.
setName(e.target.value)} />
setSlug(e.target.value)} placeholder="tenant-slug" />