11"use client" ;
22
33import { Button } from "@/components/ui/button" ;
4+ import { saveWork } from "@/lib/actions/saveWork" ;
45import { AnimatePresence , motion } from "framer-motion" ;
56import {
67 AlertCircle ,
@@ -85,7 +86,7 @@ export default function UploadPage() {
8586 setError ( null ) ;
8687 setSvgResult ( null ) ;
8788 } ,
88- [ setError , setUploadedFiles , setSvgResult ] ,
89+ [ setError , setUploadedFiles , setSvgResult ]
8990 ) ;
9091
9192 const handleDrop = useCallback (
@@ -98,7 +99,7 @@ export default function UploadPage() {
9899 handleFiles ( files ) ;
99100 }
100101 } ,
101- [ handleFiles ] ,
102+ [ handleFiles ]
102103 ) ;
103104
104105 const handleDragOver = useCallback ( ( e : React . DragEvent < HTMLDivElement > ) => {
@@ -174,6 +175,14 @@ export default function UploadPage() {
174175 setError ( "Failed to upload image. Please try again." ) ;
175176 } finally {
176177 setIsUploading ( false ) ;
178+ saveWork (
179+ // "085c190b-63be-4e54-81cf-7665e558493d",
180+ "Sample Title" ,
181+ "Sample Description" ,
182+ "https://example.com/image.png" ,
183+ "https://example.com/image.svg" ,
184+ svgResult || ""
185+ ) ;
177186 }
178187 } ;
179188
@@ -223,7 +232,7 @@ export default function UploadPage() {
223232 if ( ! / v i e w B o x = / . test ( svg ) ) {
224233 svg = svg . replace (
225234 / < s v g ( [ ^ > ] * ) > / ,
226- `<svg$1 viewBox="0 0 ${ width } ${ height } ">` ,
235+ `<svg$1 viewBox="0 0 ${ width } ${ height } ">`
227236 ) ;
228237 }
229238 }
@@ -398,8 +407,8 @@ export default function UploadPage() {
398407 { file . progress === 0
399408 ? "Ready to convert"
400409 : file . progress < 100
401- ? `Converting... ${ file . progress } %`
402- : "Conversion complete!" }
410+ ? `Converting... ${ file . progress } %`
411+ : "Conversion complete!" }
403412 </ span >
404413 { file . progress === 100 && ! isUploading && (
405414 < motion . div
0 commit comments