From 50525ad8810de356856eb098a1e0882ce3607b9f Mon Sep 17 00:00:00 2001
From: Sebastien Castiel <sebastien@castiel.me>
Date: Wed, 14 Feb 2024 09:45:10 -0500
Subject: Add cancel button on expense form (fixes #92)

---
 src/components/expense-form.tsx | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'src/components/expense-form.tsx')

diff --git a/src/components/expense-form.tsx b/src/components/expense-form.tsx
index 431afc0..fd3f6e2 100644
--- a/src/components/expense-form.tsx
+++ b/src/components/expense-form.tsx
@@ -39,6 +39,7 @@ import { ExpenseFormValues, expenseFormSchema } from '@/lib/schemas'
 import { cn } from '@/lib/utils'
 import { zodResolver } from '@hookform/resolvers/zod'
 import { Save, Trash2 } from 'lucide-react'
+import Link from 'next/link'
 import { useSearchParams } from 'next/navigation'
 import { useState } from 'react'
 import { useForm } from 'react-hook-form'
@@ -583,6 +584,9 @@ export function ExpenseForm({
               Delete
             </AsyncButton>
           )}
+          <Button variant="ghost" asChild>
+            <Link href={`/groups/${group.id}`}>Cancel</Link>
+          </Button>
         </div>
       </form>
     </Form>
-- 
cgit v1.3

