feat: add Twitter support to business profile and implement DashboardProfile component

This commit is contained in:
2026-05-09 21:19:52 +02:00
parent 6acd5ebe2e
commit f6e3c1bb8c
3 changed files with 10 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
"use client"; "use client";
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Image as ImageIcon, Sparkles, Youtube, X, Globe, Facebook, Linkedin, Instagram, CheckCircle, AlertCircle, Hash } from 'lucide-react'; import { Image as ImageIcon, Sparkles, Youtube, X, Globe, Facebook, Linkedin, Instagram, Twitter, CheckCircle, AlertCircle, Hash } from 'lucide-react';
import { Business, Country } from '../../types'; import { Business, Country } from '../../types';
import TagInput from '../TagInput'; import TagInput from '../TagInput';
import { generateBusinessDescription } from '../../lib/geminiService'; import { generateBusinessDescription } from '../../lib/geminiService';
@@ -42,6 +42,7 @@ const normalizeBusinessData = (b: Business): Business => ({
facebook: b.socialLinks?.facebook || '', facebook: b.socialLinks?.facebook || '',
linkedin: b.socialLinks?.linkedin || '', linkedin: b.socialLinks?.linkedin || '',
instagram: b.socialLinks?.instagram || '', instagram: b.socialLinks?.instagram || '',
twitter: b.socialLinks?.twitter || '',
website: b.socialLinks?.website || '', website: b.socialLinks?.website || '',
} }
}); });
@@ -721,6 +722,12 @@ const DashboardProfile = ({ business, setBusiness }: { business: Business, setBu
</span> </span>
<input type="text" placeholder="Lien Instagram" value={formData.socialLinks?.instagram || ''} onChange={(e) => handleSocialChange('instagram', e.target.value)} className="flex-1 min-w-0 block w-full px-3 py-2 rounded-none rounded-r-md focus:ring-brand-500 focus:border-brand-500 sm:text-sm border-gray-300" /> <input type="text" placeholder="Lien Instagram" value={formData.socialLinks?.instagram || ''} onChange={(e) => handleSocialChange('instagram', e.target.value)} className="flex-1 min-w-0 block w-full px-3 py-2 rounded-none rounded-r-md focus:ring-brand-500 focus:border-brand-500 sm:text-sm border-gray-300" />
</div> </div>
<div className="flex rounded-md shadow-sm">
<span className="inline-flex items-center px-3 rounded-l-md border border-r-0 border-gray-300 bg-gray-50 text-gray-500">
<Twitter className="w-4 h-4" />
</span>
<input type="text" placeholder="Lien Twitter (X)" value={formData.socialLinks?.twitter || ''} onChange={(e) => handleSocialChange('twitter', e.target.value)} className="flex-1 min-w-0 block w-full px-3 py-2 rounded-none rounded-r-md focus:ring-brand-500 focus:border-brand-500 sm:text-sm border-gray-300" />
</div>
</div> </div>
</div> </div>
</div> </div>

2
next-env.d.ts vendored
View File

@@ -1,6 +1,6 @@
/// <reference types="next" /> /// <reference types="next" />
/// <reference types="next/image-types/global" /> /// <reference types="next/image-types/global" />
import "./.next/dev/types/routes.d.ts"; import "./.next/types/routes.d.ts";
// NOTE: This file should not be edited // NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information. // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

View File

@@ -24,6 +24,7 @@ export interface SocialLinks {
facebook?: string; facebook?: string;
linkedin?: string; linkedin?: string;
instagram?: string; instagram?: string;
twitter?: string;
website?: string; website?: string;
} }