+ );
+ case 2: // Basics (Capacity)
+ return (
+
+
Share some basics about your place
+
+ {[
+ { label: 'Guests', field: 'guests', icon: Users },
+ { label: 'Bedrooms', field: 'bedrooms', icon: Moon },
+ { label: 'Beds', field: 'beds', icon: Bed },
+ { label: 'Bathrooms', field: 'bathrooms', icon: Toilet },
+ ].map((item) => {
+ const Icon = item.icon;
+ return (
+
+
+
+ {item.label}
+
+
+
handleChange(item.field as keyof FormData, Math.max(0, (formData[item.field as keyof FormData] as number) - 1))}
+ className="w-8 h-8 rounded-full border border-gray-300 flex items-center justify-center hover:border-black transition-colors cursor-pointer hover:bg-[#E7FE78] hover:border-2"
+ >
+
+
+
{formData[item.field as keyof FormData] as number}
+
handleChange(item.field as keyof FormData, (formData[item.field as keyof FormData] as number) + 1)}
+ className="w-8 h-8 rounded-full border border-gray-300 flex items-center justify-center hover:border-black transition-colors cursor-pointer hover:bg-[#E7FE78] hover:border-2"
+ >
+
+
+
+
+ );
+ })}
+
+
+ );
+ case 3: // Description
+ return (
+
+
Describe your place
+
+
+ Title
+ handleChange('title', e.target.value)}
+ placeholder="e.g. Charming Lakeside Cabin"
+ className={`${figtree.className} w-full p-4 border-2 border-gray-200 rounded-xl focus:border-black focus:outline-none transition-colors text-lg`}
+ />
+
+
+ Description
+
+
+
+ );
+ case 4: // Amenities
+ return (
+
+ );
+ case 5: // Photos
+ return (
+
+
+
Add some photos
+
You need at least 5 photos to publish your listing.
+
+
+
document.getElementById('photo-upload')?.click()}
+ className="border-2 border-dashed border-gray-300 rounded-xl p-12 flex flex-col items-center justify-center space-y-4 hover:border-black transition-colors cursor-pointer bg-gray-50"
+ >
+
{
+ if (e.target.files) {
+ const newPhotos = Array.from(e.target.files);
+ setFormData(prev => ({ ...prev, photos: [...prev.photos, ...newPhotos] }));
+ setError('');
+ }
+ }}
+ />
+
+
+
Click to upload photos
+
Select multiple files
+
+
+
+ {error && (
+
+
+ {error}
+
+ )}
+
+
+ {formData.photos.length > 0 && formData.photos.map((photo, index) => (
+
+
+ setFormData(prev => ({
+ ...prev,
+ photos: prev.photos.filter((_, i) => i !== index)
+ }))}
+ className="absolute top-2 right-2 bg-white p-1 rounded-full shadow-md opacity-0 group-hover:opacity-100 transition-opacity"
+ >
+
+
- );
- })}
+ ))}
+
+
+ );
+ case 6: // Instant Approval
+ return (
+
+ );
+ case 7: // Preview
+ return (
+
+ );
+ default:
+ return null;
+ }
+ };
+
+ return (
+
+ {/* Header / Progress with max-width for better readability */}
+ {!isSuccess && (
+
+
+
Step {step + 1} of 8
+
+ {Array.from({ length: 8 }).map((_, i) => (
+
+ ))}
+
+ )}
- {/* Scrollable Content */}
-
-
-
-
+ {/* Content Form */}
+
- {/* Fixed Footer Navigation */}
-
+ {/* Footer Navigation */}
+ {!isSuccess && (
+
- Back
+ Back
-
- {step === totalSteps - 1 ? 'Finish' : 'Next'}
-
-
-
- {/* Right Panel - Live Preview */}
-
- {/* Background Pattern */}
-
-
-
-
-
What guests will see
-
As you update your listing, see how it looks in search results.
-
-
+ {step === 7 ? (
+
+ {isSubmitting ? 'Submitting...' : 'Submit Listing'}
+
+ ) : (
+
+ Next
+
+ )}
-
+ )}
- )
+ );
}
-
-export default List;
diff --git a/src/components/list-property/styles.ts b/src/components/list-property/styles.ts
deleted file mode 100644
index 423f47d..0000000
--- a/src/components/list-property/styles.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import localFont from "next/font/local";
-
-export const figtree = localFont({
- src: [
- {
- path: '../../../public/Fonts/figtree/figtree.ttf',
- },
- ],
-})
-
-export const containerStyle = `flex flex-col gap-8 w-full max-w-xl mx-auto pb-24`; // Added padding bottom for fixed footer
-export const titleStyle = `${figtree.className} text-4xl font-bold mb-2`;
-export const subtitleStyle = `${figtree.className} text-lg text-gray-500 mb-8`;
-export const inputStyle = `${figtree.className} w-full p-4 border-2 border-black text-lg outline-none focus:bg-[#F7F7F7] transition-colors placeholder:text-gray-400`;
-export const buttonStyle = `${figtree.className} flex items-center justify-center gap-2 px-8 py-3 border-2 border-black bg-[#E7FE78] text-lg font-medium hover:bg-[#dcfc4e] transition-colors disabled:opacity-50 disabled:cursor-not-allowed shadow-[4px_4px_0px_0px_rgba(0,0,0,1)] hover:translate-y-[2px] hover:shadow-[2px_2px_0px_0px_rgba(0,0,0,1)] active:translate-y-[4px] active:shadow-none transition-all`;
-export const secondaryButtonStyle = `${figtree.className} flex items-center justify-center gap-2 px-8 py-3 border-2 border-black bg-white text-lg font-medium hover:bg-gray-50 transition-colors shadow-[4px_4px_0px_0px_rgba(0,0,0,1)] hover:translate-y-[2px] hover:shadow-[2px_2px_0px_0px_rgba(0,0,0,1)] active:translate-y-[4px] active:shadow-none transition-all`;
-export const optionCardStyle = (selected: boolean) =>
- `flex flex-col items-center justify-center gap-4 p-6 border-2 border-black cursor-pointer transition-all ${selected ? 'bg-[#E7FE78]' : 'bg-white hover:bg-gray-50'}`;
diff --git a/src/components/list-property/types.ts b/src/components/list-property/types.ts
deleted file mode 100644
index a952c3f..0000000
--- a/src/components/list-property/types.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-export interface FormData {
- propertyType?: string;
- placeType?: string;
- location?: string;
- guests?: number;
- bedrooms?: number;
- beds?: number;
- bathrooms?: number;
- amenities?: string[];
- description?: string;
- price?: string;
- instantBook?: boolean;
- safety?: string[];
- title?: string;
- photos?: string[];
-}
-
-export type FormValue = string | number | boolean | string[] | undefined;
-
-export interface StepProps {
- data: FormData;
- updateData: (key: keyof FormData, value: FormValue) => void;
-}