export const CHANNELS = [
  { id: "all",       label: "All",           icon: "ti-inbox" },
  { id: "email",     label: "Email",          icon: "ti-mail",                  color: "#4F46E5" },
  { id: "whatsapp",  label: "WhatsApp",       icon: "ti-brand-whatsapp",        color: "#25D366" },
  { id: "messenger", label: "Messenger",      icon: "ti-brand-messenger",       color: "#0084FF" },
  { id: "telegram",  label: "Telegram",       icon: "ti-brand-telegram",        color: "#26A5E4" },
  { id: "instagram", label: "Instagram DM",   icon: "ti-brand-instagram",       color: "#E1306C" },
  { id: "sms",       label: "SMS",            icon: "ti-device-mobile-message", color: "#6366F1" },
  { id: "viber",     label: "Viber",          icon: "letter:Vi",                color: "#7360F2" },
  { id: "wechat",    label: "WeChat",         icon: "ti-brand-wechat",          color: "#07C160" },
  { id: "line",      label: "LINE",           icon: "ti-brand-line",            color: "#06C755" },
];

export const AGENTS = ["Alice Wang", "Ben Torres", "Clara Kim", "David Patel", "Unassigned"];

export const SAVED_REPLIES = [
  { id: 1, title: "Greeting", body: "Hi! Thanks for reaching out. How can I assist you today?" },
  { id: 2, title: "Shipping Info", body: "Your order typically ships within 2-3 business days. You'll receive a tracking email once dispatched." },
  { id: 3, title: "Refund Policy", body: "We offer a 30-day hassle-free return policy. Please share your order number and we'll get it sorted." },
  { id: 4, title: "Escalation", body: "I'm escalating this to our specialist team. You'll hear back within 24 hours." },
  { id: 5, title: "Closing", body: "Is there anything else I can help you with today? We appreciate your patience!" },
];

export const DUMMY_CONVERSATIONS = [
  {
    id: 1,
    channel: "email",
    name: "Sarah Mitchell",
    avatar: "SM",
    status: "open",
    subject: "Order #8842 not received",
    preview: "Hi, I placed an order 10 days ago and...",
    time: "2m ago",
    unread: 3,
    assignee: "Alice Wang",
    slaDeadline: 15,
    slaUnit: "min",
    priority: "high",
    messages: [
      { id: 1, sender: "Sarah Mitchell", text: "Hi, I placed an order 10 days ago and still haven't received it. The tracking shows it's stuck.", time: "10:02 AM", isAgent: false },
      { id: 2, sender: "Alice Wang", text: "Hi Sarah! I'm so sorry to hear that. Let me pull up your order details right away.", time: "10:05 AM", isAgent: true },
      { id: 3, sender: "Sarah Mitchell", text: "The order number is #8842. I really need this by Friday.", time: "10:06 AM", isAgent: false },
    ],
    notes: ["Customer is a VIP. Handle with priority.", "Escalate if unresolved after 1 hour."],
  },
  {
    id: 2,
    channel: "whatsapp",
    name: "Carlos Rivera",
    avatar: "CR",
    status: "open",
    subject: "Billing issue on last invoice",
    preview: "Hello, I was charged twice for...",
    time: "8m ago",
    unread: 1,
    assignee: "Ben Torres",
    slaDeadline: 45,
    slaUnit: "min",
    priority: "medium",
    messages: [
      { id: 1, sender: "Carlos Rivera", text: "Hello, I was charged twice for the same subscription this month.", time: "9:45 AM", isAgent: false },
      { id: 2, sender: "Ben Torres", text: "Hey Carlos, I can see the duplicate charge. I'll initiate a refund now.", time: "9:50 AM", isAgent: true },
    ],
    notes: ["Duplicate Stripe charge confirmed. Refund initiated."],
  },
  {
    id: 3,
    channel: "messenger",
    name: "Emma Johnson",
    avatar: "EJ",
    status: "pending",
    subject: "Product compatibility question",
    preview: "Does your software work with...",
    time: "22m ago",
    unread: 0,
    assignee: "Unassigned",
    slaDeadline: 2,
    slaUnit: "hr",
    priority: "low",
    messages: [
      { id: 1, sender: "Emma Johnson", text: "Does your software work with macOS Ventura?", time: "9:30 AM", isAgent: false },
    ],
    notes: [],
  },
  {
    id: 4,
    channel: "telegram",
    name: "Liam Chen",
    avatar: "LC",
    status: "resolved",
    subject: "Reset 2FA setup",
    preview: "I lost access to my authenticator app...",
    time: "1h ago",
    unread: 0,
    assignee: "Clara Kim",
    slaDeadline: 0,
    slaUnit: "hr",
    priority: "medium",
    messages: [
      { id: 1, sender: "Liam Chen", text: "I lost access to my authenticator app and can't log in.", time: "8:15 AM", isAgent: false },
      { id: 2, sender: "Clara Kim", text: "No worries! I'll send you a secure reset link to your email now.", time: "8:20 AM", isAgent: true },
      { id: 3, sender: "Liam Chen", text: "Got it, thank you so much!", time: "8:25 AM", isAgent: false },
    ],
    notes: ["2FA reset completed successfully."],
  },
  {
    id: 5,
    channel: "instagram",
    name: "Priya Sharma",
    avatar: "PS",
    status: "open",
    subject: "Collab inquiry",
    preview: "Hi! I'm an influencer with 200k followers...",
    time: "3h ago",
    unread: 2,
    assignee: "David Patel",
    slaDeadline: 4,
    slaUnit: "hr",
    priority: "low",
    messages: [
      { id: 1, sender: "Priya Sharma", text: "Hi! I'm an influencer with 200k followers and would love to collab with your brand!", time: "7:00 AM", isAgent: false },
    ],
    notes: ["Partnerships team to review."],
  },
  {
    id: 6,
    channel: "livechat",
    name: "James O'Brien",
    avatar: "JO",
    status: "open",
    subject: "Page not loading",
    preview: "Your checkout page keeps throwing a 500...",
    time: "4m ago",
    unread: 5,
    assignee: "Alice Wang",
    slaDeadline: 5,
    slaUnit: "min",
    priority: "high",
    messages: [
      { id: 1, sender: "James O'Brien", text: "Your checkout page keeps throwing a 500 error. I can't complete my purchase!", time: "10:08 AM", isAgent: false },
      { id: 2, sender: "Alice Wang", text: "I'm so sorry James! Our engineering team is aware and working on a fix right now.", time: "10:09 AM", isAgent: true },
      { id: 3, sender: "James O'Brien", text: "How long will it take? I need this urgently.", time: "10:10 AM", isAgent: false },
    ],
    notes: ["Incident #4421 opened. ETA 15 mins."],
  },
  {
    id: 7,
    channel: "sms",
    name: "Fatima Al-Hassan",
    avatar: "FA",
    status: "pending",
    subject: "Appointment reminder query",
    preview: "Did you send me an appointment reminder...",
    time: "30m ago",
    unread: 1,
    assignee: "Unassigned",
    slaDeadline: 3,
    slaUnit: "hr",
    priority: "low",
    messages: [
      { id: 1, sender: "Fatima Al-Hassan", text: "Did you send me an appointment reminder? I think it was meant for someone else.", time: "9:40 AM", isAgent: false },
    ],
    notes: [],
  },
  {
    id: 8,
    channel: "email",
    name: "Tom Nguyen",
    avatar: "TN",
    status: "resolved",
    subject: "Feature request: dark mode",
    preview: "I'd love to see a dark mode option...",
    time: "5h ago",
    unread: 0,
    assignee: "David Patel",
    slaDeadline: 0,
    slaUnit: "hr",
    priority: "low",
    messages: [
      { id: 1, sender: "Tom Nguyen", text: "I'd love to see a dark mode option in your dashboard!", time: "5:00 AM", isAgent: false },
      { id: 2, sender: "David Patel", text: "Thanks for the suggestion, Tom! I've logged it with our product team.", time: "6:00 AM", isAgent: true },
    ],
    notes: ["Feature request logged in Jira as FEAT-992."],
  },
];

export const channelMeta = (id) => CHANNELS.find((channel) => channel.id === id) || CHANNELS[0];

export const priorityConfig = {
  high: { label: "High", bg: "bg-red-100 text-red-700", dot: "bg-red-500" },
  medium: { label: "Medium", bg: "bg-amber-100 text-amber-700", dot: "bg-amber-500" },
  low: { label: "Low", bg: "bg-green-100 text-green-700", dot: "bg-green-500" },
};

export const statusConfig = {
  open: { label: "Open", cls: "bg-blue-100 text-blue-700" },
  pending: { label: "Pending", cls: "bg-amber-100 text-amber-700" },
  resolved: { label: "Resolved", cls: "bg-green-100 text-green-700" },
};

export const STATUS_FILTERS = ["all", "open", "pending", "resolved"];
