From 9437f2c7d887aca5898872b89706b58995a66232 Mon Sep 17 00:00:00 2001 From: Matthew Ameh Date: Tue, 30 Jul 2024 01:40:31 +0100 Subject: [PATCH] imagebody component --- .../_components/ImageBody.tsx | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 src/app/dashboard/(admin)/admin/email/edit-in-buit-templates/_components/ImageBody.tsx diff --git a/src/app/dashboard/(admin)/admin/email/edit-in-buit-templates/_components/ImageBody.tsx b/src/app/dashboard/(admin)/admin/email/edit-in-buit-templates/_components/ImageBody.tsx new file mode 100644 index 000000000..6cc7f5427 --- /dev/null +++ b/src/app/dashboard/(admin)/admin/email/edit-in-buit-templates/_components/ImageBody.tsx @@ -0,0 +1,62 @@ +"use client"; + +import Image from "next/image"; +import React, { useState } from "react"; + +const ImageBody: React.FC = () => { + const [selectedImage, setSelectedImage] = useState< + string | ArrayBuffer | undefined + >(); + + const handleImageChange = (event: React.ChangeEvent) => { + const file = event.target.files?.[0]; + if (file) { + const reader = new FileReader(); + reader.onloadend = () => { + setSelectedImage(reader.result ?? undefined); + }; + reader.readAsDataURL(file); + } + }; + + return ( +
+ +
+

+ Welcome to Boilerplate! +

+

Thanks for signing up

+
+
+ ); +}; + +export default ImageBody;