From 83f45d26638c45b7ea34461ce277c2be12c48951 Mon Sep 17 00:00:00 2001 From: Brandon Egger Date: Thu, 25 May 2023 23:03:13 -0500 Subject: [PATCH] add input lines for manufacturer and resource name --- src/components/admin/resources/form.tsx | 43 +++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/src/components/admin/resources/form.tsx b/src/components/admin/resources/form.tsx index cfce9d6..df75979 100644 --- a/src/components/admin/resources/form.tsx +++ b/src/components/admin/resources/form.tsx @@ -1,6 +1,7 @@ import { type AuditoryResource } from "@prisma/client"; import Image from "next/image"; import { PencilSquareIcon } from "@heroicons/react/24/solid"; +import { useState } from "react"; /** * Renders the image selector for resource form. @@ -55,6 +56,32 @@ const ResourceLinkSubForm = ({ resource }: { resource?: AuditoryResource }) => { ); }; +/** + * Single line input for the fields found to the right of the + * resource logo. + */ +const InfoInputLine = ({ + value, + placeholder, +}: { + value: string; + placeholder: string; +}) => { + const [currentValue, setCurrentValue] = useState(value); + + return ( + { + setCurrentValue(event.target.value); + }} + placeholder={placeholder} + value={currentValue} + type="text" + className="w-full border-b border-neutral-300 px-2" + /> + ); +}; + /** * Resource summary inputs - ie description, manufacturer, etc. */ @@ -69,10 +96,20 @@ const ResourceSummarySubForm = ({
+
+ + + + + + Edit the fields above + +
-
- {/** Manufacturer info */} -
+
Ages {/** Age range here */}