diff --git a/apps/app/src/components/Changelog/Version/Create/Step01.tsx b/apps/app/src/components/Changelog/Version/Create/Step01.tsx
index c6d30fc..ebf11c9 100644
--- a/apps/app/src/components/Changelog/Version/Create/Step01.tsx
+++ b/apps/app/src/components/Changelog/Version/Create/Step01.tsx
@@ -1,17 +1,21 @@
import { Link, useParams } from '@tanstack/react-router'
import { HandIcon, WorkflowIcon } from 'lucide-react'
-export const ChangelogVersionCreateStep01 = () => {
+export const ChangelogVersionCreateStep01 = ({
+ nextStep,
+}: { nextStep: () => void }) => {
const { id } = useParams({ from: '/changelog/$id' })
+
return (
-
+
+
{
+ const { id } = useParams({ from: '/changelog/$id' })
+ const navigate = useNavigate({ from: `/changelog/${id}` })
+ const autoVersion = useChangelogVersionCreateAuto()
+
+ const form = useForm
>({
+ resolver: zodResolver(VersionCreateAutoInput),
+ defaultValues: {
+ changelogId: id,
+ version: null,
+ },
+ })
+
+ const onSubmit = (values: z.infer) => {
+ autoVersion.mutate(values, {
+ onSuccess(data) {
+ navigate({
+ to: '/changelog/$id/version/$versionId',
+ params: { id, versionId: data.id },
+ })
+ },
+ })
+ }
+
+ return (
+
+ )
+}
diff --git a/apps/app/src/components/Changelog/Version/Create/index.tsx b/apps/app/src/components/Changelog/Version/Create/index.tsx
index 466de35..f78cbc5 100644
--- a/apps/app/src/components/Changelog/Version/Create/index.tsx
+++ b/apps/app/src/components/Changelog/Version/Create/index.tsx
@@ -7,11 +7,23 @@ import {
DialogTrigger,
} from '@boring.tools/ui'
import { PlusCircleIcon } from 'lucide-react'
+import { useEffect, useState } from 'react'
import { ChangelogVersionCreateStep01 } from './Step01'
+import { ChangelogVersionCreateStep02 } from './Step02'
export const ChangelogVersionCreate = () => {
+ const [isOpen, setIsOpen] = useState(false)
+ const [step, setStep] = useState(1)
+ const nextStep = () => setStep((prev) => prev + 1)
+
+ useEffect(() => {
+ if (!isOpen) {
+ setStep(1)
+ }
+ }, [isOpen])
+
return (
-