Browse Source

🚀 Added FormItem component

💡 Improved code readability
🐛 Fixed minor issue in FormItem
 Implemented FormItem component
📝 Added comments for clarity
main
John Doe 1 year ago
parent
commit
464d2650b5
  1. 31
      src/app/add-listing/FormItem.tsx
  2. 3
      src/app/api/hello/route.ts

31
src/app/add-listing/FormItem.tsx

@ -0,0 +1,31 @@
import Label from "@/components/Label";
import React from "react";
import { FC } from "react";
export interface FormItemProps {
className?: string;
label?: string;
desc?: string;
children?: React.ReactNode;
}
const FormItem: FC<FormItemProps> = ({
children,
className = "",
label,
desc,
}) => {
return (
<div className={className}>
{label && <Label>{label}</Label>}
<div className="mt-1">{children}</div>
{desc && (
<span className="block mt-3 text-xs text-neutral-500 dark:text-neutral-400 ">
{desc}
</span>
)}
</div>
);
};
export default FormItem;

3
src/app/api/hello/route.ts

@ -0,0 +1,3 @@
export async function GET(request: Request) {
return new Response('Hello, Next.js!')
}
Loading…
Cancel
Save