adding brand management

This commit is contained in:
fahed
2026-02-10 21:03:36 +03:00
parent 334727b232
commit f3e6fc848d
15 changed files with 568 additions and 864 deletions

View File

@@ -1,13 +1,17 @@
import { useContext } from 'react'
import { format } from 'date-fns'
import { ArrowRight } from 'lucide-react'
import { getInitials } from '../utils/api'
import { useLanguage } from '../i18n/LanguageContext'
import { AppContext } from '../App'
import BrandBadge from './BrandBadge'
import StatusBadge from './StatusBadge'
import { PlatformIcons } from './PlatformIcon'
export default function PostCard({ post, onClick, onMove, compact = false }) {
const { t } = useLanguage()
const { getBrandName } = useContext(AppContext)
const brandName = getBrandName(post.brand_id || post.brandId) || post.brand_name || post.brand
// Support both single platform and platforms array
const platforms = post.platforms?.length > 0
? post.platforms
@@ -35,7 +39,7 @@ export default function PostCard({ post, onClick, onMove, compact = false }) {
</div>
<div className="flex items-center gap-2 flex-wrap">
{post.brand && <BrandBadge brand={post.brand} />}
{brandName && <BrandBadge brand={brandName} />}
</div>
<div className="flex items-center justify-between mt-3 pt-2 border-t border-border-light">
@@ -101,7 +105,7 @@ export default function PostCard({ post, onClick, onMove, compact = false }) {
<span className="text-sm font-medium text-text-primary">{post.title}</span>
</div>
</td>
<td className="px-4 py-3">{post.brand && <BrandBadge brand={post.brand} />}</td>
<td className="px-4 py-3">{brandName && <BrandBadge brand={brandName} />}</td>
<td className="px-4 py-3"><StatusBadge status={post.status} /></td>
<td className="px-4 py-3">
<PlatformIcons platforms={platforms} size={16} gap="gap-1.5" />