From 40ae54a4e665c16ea0355d211534df7132c16ba1 Mon Sep 17 00:00:00 2001 From: Zeddnyx Date: Sat, 22 Jun 2024 21:57:17 +0700 Subject: [PATCH] ui(file upload) --- components/form/input-file/file-multiple.tsx | 10 +++- components/form/input-file/file.tsx | 14 +++-- components/form/input-file/image-multiple.tsx | 21 +++++-- components/form/input-file/image.tsx | 12 +++- components/form/input-file/preview-file.tsx | 26 ++++++-- components/form/input-file/preview-img.tsx | 20 +++++-- components/ui/form/File.tsx | 59 +++++++++++++------ constants/index.ts | 4 ++ types/index.ts | 4 +- 9 files changed, 126 insertions(+), 44 deletions(-) diff --git a/components/form/input-file/file-multiple.tsx b/components/form/input-file/file-multiple.tsx index 8de2582..8334621 100644 --- a/components/form/input-file/file-multiple.tsx +++ b/components/form/input-file/file-multiple.tsx @@ -1,9 +1,11 @@ "use client"; -import FileInput from "@/components/ui/form/File"; import { useState } from "react"; +import FileInput from "@/components/ui/form/File"; + export default function File() { const [file, setFile] = useState([]); + return ( -

Click here

-

or drag and drop

+
+

Click here

+

or drag and drop here

+
); } diff --git a/components/form/input-file/file.tsx b/components/form/input-file/file.tsx index b4e1190..292cf87 100644 --- a/components/form/input-file/file.tsx +++ b/components/form/input-file/file.tsx @@ -1,14 +1,20 @@ "use client"; -import Button from "@/components/ui/component/Button"; -import FileInput from "@/components/ui/form/File"; import { useState } from "react"; +import FileInput from "@/components/ui/form/File"; +import { cn } from "@/lib/utils"; + export default function File() { const [file, setFile] = useState([]); + return ( -