From 95a7cbaf0dfad65cef4ed455d742f2409991ea5a Mon Sep 17 00:00:00 2001 From: egecankomur Date: Wed, 6 May 2026 23:04:26 +0300 Subject: [PATCH] =?UTF-8?q?feat:=20onboarding'de=20di=C4=9Fer=20KovakSoft?= =?UTF-8?q?=20uygulamalar=C4=B1ndan=20workspace=20i=C3=A7e=20aktarma?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/create-workspace-form.tsx | 81 ++++++++++++++----- src/app/onboarding/page.tsx | 17 ++-- src/lib/appwrite/tenant-actions.ts | 50 ++++++++++++ src/lib/appwrite/tenant.ts | 23 ++++++ 4 files changed, 144 insertions(+), 27 deletions(-) diff --git a/src/app/onboarding/components/create-workspace-form.tsx b/src/app/onboarding/components/create-workspace-form.tsx index dafb9e2..a6b8c32 100644 --- a/src/app/onboarding/components/create-workspace-form.tsx +++ b/src/app/onboarding/components/create-workspace-form.tsx @@ -1,21 +1,30 @@ "use client"; import { useActionState } from "react"; -import { Building2, Loader2, ShieldCheck } from "lucide-react"; +import { Building2, Loader2, ShieldCheck, ArrowRight } from "lucide-react"; 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 { Logo } from "@/components/logo"; -import { createWorkspaceAction } from "@/lib/appwrite/tenant-actions"; +import { createWorkspaceAction, importWorkspaceAction } from "@/lib/appwrite/tenant-actions"; import { initialWorkspaceState } from "@/lib/appwrite/tenant-types"; -export function CreateWorkspaceForm({ userName }: { userName?: string }) { +interface Props { + userName?: string; + crossAppTeams?: Array<{ $id: string; name: string }>; +} + +export function CreateWorkspaceForm({ userName, crossAppTeams = [] }: Props) { const [state, formAction, isPending] = useActionState( createWorkspaceAction, initialWorkspaceState, ); + const [, importFormAction, isImporting] = useActionState( + importWorkspaceAction, + initialWorkspaceState, + ); return (
@@ -23,9 +32,54 @@ export function CreateWorkspaceForm({ userName }: { userName?: string }) {
- İşletmem + Kovak Emlak CRM
+ {/* Cross-app import section */} + {crossAppTeams.length > 0 && ( + + + Mevcut şirketinizi ekleyin + + Diğer bir KovakSoft uygulamasında kayıtlı şirketinizi tek tıkla buraya ekleyebilirsiniz. + + + + {crossAppTeams.map((team) => ( +
+ + +
+ ))} +
+
+ )} + + {crossAppTeams.length > 0 && ( +
+
+ +
+
+ veya yeni oluştur +
+
+ )} +
@@ -35,37 +89,24 @@ export function CreateWorkspaceForm({ userName }: { userName?: string }) { {userName ? `Hoş geldiniz, ${userName}` : "Çalışma alanı oluştur"} - Şirketinizin bilgilerini girin — birkaç saniyede çalışma alanınız hazır. + Ofis bilgilerini girin — birkaç saniyede çalışma alanınız hazır.
- +
-
- - -
-