Home / Function/ getBadgeVariantFromLabel() — ui Function Reference

getBadgeVariantFromLabel() — ui Function Reference

Architecture documentation for the getBadgeVariantFromLabel() function in mail-list.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  958d5560_cef6_cca5_832b_dc8a9913d5b1["getBadgeVariantFromLabel()"]
  59bf1756_2b53_5adb_7ea0_d474349e159f["mail-list.tsx"]
  958d5560_cef6_cca5_832b_dc8a9913d5b1 -->|defined in| 59bf1756_2b53_5adb_7ea0_d474349e159f
  7e7aaa74_bdc1_bc00_3e41_8a312c8cc072["MailList()"]
  7e7aaa74_bdc1_bc00_3e41_8a312c8cc072 -->|calls| 958d5560_cef6_cca5_832b_dc8a9913d5b1
  style 958d5560_cef6_cca5_832b_dc8a9913d5b1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

deprecated/www/app/(app)/examples/mail/components/mail-list.tsx lines 77–89

function getBadgeVariantFromLabel(
  label: string
): ComponentProps<typeof Badge>["variant"] {
  if (["work"].includes(label.toLowerCase())) {
    return "default"
  }

  if (["personal"].includes(label.toLowerCase())) {
    return "outline"
  }

  return "secondary"
}

Subdomains

Called By

Frequently Asked Questions

What does getBadgeVariantFromLabel() do?
getBadgeVariantFromLabel() is a function in the ui codebase, defined in deprecated/www/app/(app)/examples/mail/components/mail-list.tsx.
Where is getBadgeVariantFromLabel() defined?
getBadgeVariantFromLabel() is defined in deprecated/www/app/(app)/examples/mail/components/mail-list.tsx at line 77.
What calls getBadgeVariantFromLabel()?
getBadgeVariantFromLabel() is called by 1 function(s): MailList.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free