mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-11 17:26:45 +02:00
- Nouveaux tokens (indigo/corail, statuts, plateformes) et mode sombre - Logo et favicon Social Flow redessinés - AppShell partagé : sidebar groupée (desktop) + barre de navigation basse (mobile) - Suppression des pages mobiles dupliquées et des composants morts - Tableau de bord, connexion, 404, calendrier, médiathèque, IA, statistiques Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ADkrVcVFTT14hbB148HYS
36 lines
1.3 KiB
TypeScript
36 lines
1.3 KiB
TypeScript
import { SiFacebook, SiInstagram, SiTiktok } from "react-icons/si";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
export type Platform = "facebook" | "instagram" | "tiktok" | string;
|
|
|
|
const META: Record<string, { label: string; icon: typeof SiFacebook; text: string; bg: string }> = {
|
|
facebook: { label: "Facebook", icon: SiFacebook, text: "text-facebook", bg: "bg-facebook/10" },
|
|
instagram: { label: "Instagram", icon: SiInstagram, text: "text-instagram", bg: "bg-instagram/10" },
|
|
tiktok: { label: "TikTok", icon: SiTiktok, text: "text-tiktok", bg: "bg-tiktok/10" },
|
|
};
|
|
|
|
export function platformLabel(platform: Platform): string {
|
|
return META[platform]?.label ?? platform;
|
|
}
|
|
|
|
/** Icône de plateforme sur pastille teintée (couleurs officielles via tokens). */
|
|
export function PlatformIcon({
|
|
platform,
|
|
size = "md",
|
|
className,
|
|
}: {
|
|
platform: Platform;
|
|
size?: "sm" | "md" | "lg";
|
|
className?: string;
|
|
}) {
|
|
const meta = META[platform] ?? META.facebook;
|
|
const Icon = meta.icon;
|
|
const box = { sm: "h-7 w-7 rounded-md", md: "h-10 w-10 rounded-lg", lg: "h-12 w-12 rounded-xl" }[size];
|
|
const icon = { sm: "h-3.5 w-3.5", md: "h-5 w-5", lg: "h-6 w-6" }[size];
|
|
return (
|
|
<span className={cn("inline-flex shrink-0 items-center justify-center", box, meta.bg, meta.text, className)}>
|
|
<Icon className={icon} />
|
|
</span>
|
|
);
|
|
}
|