diff --git a/app/(dashboard)/dashboard/general/page.tsx b/app/(dashboard)/dashboard/general/page.tsx index e3e0165aa..337fd4644 100644 --- a/app/(dashboard)/dashboard/general/page.tsx +++ b/app/(dashboard)/dashboard/general/page.tsx @@ -1,34 +1,34 @@ -'use client'; +"use client" -import { useActionState } from 'react'; -import { Button } from '@/components/ui/button'; -import { Input } from '@/components/ui/input'; -import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; -import { Label } from '@/components/ui/label'; -import { Loader2 } from 'lucide-react'; -import { updateAccount } from '@/app/(login)/actions'; -import { User } from '@/lib/db/schema'; -import useSWR from 'swr'; -import { Suspense } from 'react'; +import { useActionState } from "react" +import { Button } from "@/components/ui/button" +import { Input } from "@/components/ui/input" +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" +import { Label } from "@/components/ui/label" +import { Loader2 } from "lucide-react" +import { updateAccount } from "@/app/(login)/actions" +import { User } from "@/lib/db/schema" +import useSWR from "swr" +import { Suspense } from "react" -const fetcher = (url: string) => fetch(url).then((res) => res.json()); +const fetcher = (url: string) => fetch(url).then((res) => res.json()) type ActionState = { - name?: string; - error?: string; - success?: string; -}; + name?: string + error?: string + success?: string +} type AccountFormProps = { - state: ActionState; - nameValue?: string; - emailValue?: string; -}; + state: ActionState + nameValue?: string + emailValue?: string +} function AccountForm({ state, - nameValue = '', - emailValue = '' + nameValue = "", + emailValue = "", }: AccountFormProps) { return ( <> @@ -58,25 +58,25 @@ function AccountForm({ /> - ); + ) } function AccountFormWithData({ state }: { state: ActionState }) { - const { data: user } = useSWR('/api/user', fetcher); + const { data: user } = useSWR("/api/user", fetcher) return ( - ); + ) } export default function GeneralPage() { const [state, formAction, isPending] = useActionState( updateAccount, {} - ); + ) return (
@@ -89,7 +89,7 @@ export default function GeneralPage() { Account Information -
+ }> @@ -103,6 +103,7 @@ export default function GeneralPage() { type="submit" className="bg-orange-500 hover:bg-orange-600 text-white" disabled={isPending} + formAction={formAction} > {isPending ? ( <> @@ -110,12 +111,12 @@ export default function GeneralPage() { Saving... ) : ( - 'Save Changes' + "Save Changes" )}
- ); + ) } diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..166b528f5 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,16 @@ + +services: + postgres: + image: postgres:16.4-alpine + container_name: next_saas_starter_postgres + environment: + POSTGRES_DB: postgres + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + ports: + - "54322:5432" + volumes: + - postgres_data:/var/lib/postgresql/data + +volumes: + postgres_data: