full sonner implementation

This commit is contained in:
Oliver Bryan
2026-01-12 04:55:20 +00:00
parent cd9979f813
commit 2b0bf94134
18 changed files with 209 additions and 39 deletions

View File

@@ -1,4 +1,9 @@
import { ORG_DESCRIPTION_MAX_LENGTH, ORG_NAME_MAX_LENGTH, ORG_SLUG_MAX_LENGTH } from "@issue/shared";
import {
ORG_DESCRIPTION_MAX_LENGTH,
ORG_NAME_MAX_LENGTH,
ORG_SLUG_MAX_LENGTH,
type OrganisationRecord,
} from "@issue/shared";
import { type FormEvent, useState } from "react";
import { useAuthenticatedSession } from "@/components/session-provider";
import { Button } from "@/components/ui/button";
@@ -28,7 +33,7 @@ export function CreateOrganisation({
completeAction,
}: {
trigger?: React.ReactNode;
completeAction?: (organisationId: number) => void | Promise<void>;
completeAction?: (org: OrganisationRecord) => void | Promise<void>;
}) {
const { user } = useAuthenticatedSession();
@@ -83,7 +88,7 @@ export function CreateOrganisation({
setOpen(false);
reset();
try {
await completeAction?.(data.id);
await completeAction?.(data);
} catch (actionErr) {
console.error(actionErr);
}