fix: generate board slug for new boards

This commit is contained in:
Henry
2025-01-12 09:32:31 +00:00
parent 2df54f03bb
commit 765db90570
5 changed files with 46 additions and 8 deletions

View File

@@ -1,8 +1,9 @@
import { useForm } from "react-hook-form";
import { HiXMark } from "react-icons/hi2";
import { type NewBoardInput } from "@kan/api/types";
import type { NewBoardInput } from "@kan/api/types";
import Button from "~/components/Button";
import { useModal } from "~/providers/modal";
import { useWorkspace } from "~/providers/workspace";
import { api } from "~/utils/api";
@@ -15,7 +16,7 @@ export function NewBoardForm() {
const { register, handleSubmit } = useForm<NewBoardInput>({
defaultValues: {
name: "",
workspacePublicId: workspace?.publicId || "",
workspacePublicId: workspace.publicId || "",
},
});
@@ -57,12 +58,9 @@ export function NewBoardForm() {
<div className="mt-12 flex items-center justify-end border-t border-light-600 px-5 pb-5 pt-5 dark:border-dark-600">
<div>
<button
type="submit"
className="inline-flex w-full justify-center rounded-md bg-light-1000 px-3 py-2 text-sm font-semibold text-light-50 shadow-sm focus-visible:outline-none dark:bg-dark-1000 dark:text-dark-50"
>
<Button type="submit" isLoading={createBoard.isPending}>
Create board
</button>
</Button>
</div>
</div>
</form>