@@ -13,7 +13,7 @@ import {
1313import { Badge } from '@/components/ui/badge' ;
1414import { Input } from '@/components/ui/input' ;
1515import { Minus , Plus , Trash2 , ShoppingCart , ArrowRight } from 'lucide-react' ;
16- import { useToast } from '@/hooks/use-toast ' ;
16+ import { toast } from 'sonner ' ;
1717import { useRouter } from 'next/navigation' ;
1818
1919interface CartItem {
@@ -67,7 +67,6 @@ export function CartList() {
6767 const [ cart , setCart ] = useState < Cart | null > ( null ) ;
6868 const [ loading , setLoading ] = useState ( true ) ;
6969 const [ updatingItems , setUpdatingItems ] = useState < Set < string > > ( new Set ( ) ) ;
70- const { toast } = useToast ( ) ;
7170 const router = useRouter ( ) ;
7271
7372 useEffect ( ( ) => {
@@ -121,15 +120,9 @@ export function CartList() {
121120 } ;
122121 } ) ;
123122
124- toast ( {
125- title : 'Cart updated' ,
126- description : 'Item quantity updated successfully' ,
127- } ) ;
123+ toast . success ( 'Item quantity updated successfully' ) ;
128124 } catch {
129- toast ( {
130- title : 'Update failed' ,
131- description : 'Failed to update item quantity' ,
132- } ) ;
125+ toast . error ( 'Failed to update item quantity' ) ;
133126 } finally {
134127 setUpdatingItems ( prev => {
135128 const next = new Set ( prev ) ;
@@ -158,15 +151,9 @@ export function CartList() {
158151 } ;
159152 } ) ;
160153
161- toast ( {
162- title : 'Item removed' ,
163- description : 'Item removed from cart' ,
164- } ) ;
154+ toast . success ( 'Item removed from cart' ) ;
165155 } catch {
166- toast ( {
167- title : 'Remove failed' ,
168- description : 'Failed to remove item from cart' ,
169- } ) ;
156+ toast . error ( 'Failed to remove item from cart' ) ;
170157 } finally {
171158 setUpdatingItems ( prev => {
172159 const next = new Set ( prev ) ;
@@ -188,15 +175,9 @@ export function CartList() {
188175
189176 setCart ( { ...mockCart , items : [ ] , itemCount : 0 , subtotal : 0 , total : 0 } ) ;
190177
191- toast ( {
192- title : 'Cart cleared' ,
193- description : 'All items removed from cart' ,
194- } ) ;
178+ toast . success ( 'All items removed from cart' ) ;
195179 } catch {
196- toast ( {
197- title : 'Clear failed' ,
198- description : 'Failed to clear cart' ,
199- } ) ;
180+ toast . error ( 'Failed to clear cart' ) ;
200181 }
201182 } ;
202183
0 commit comments