Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

refactor(web): Cleanup `StatusBadge` (#15497)

claude[bot]1bb37478e9e2
diff --git a/web/src/components/TruncatedLabels.tsx b/web/src/components/TruncatedLabels.tsx
index e48bed4f4e..2b055013dc 100644
--- a/web/src/components/TruncatedLabels.tsx
+++ b/web/src/components/TruncatedLabels.tsx
@@ -5,7 +5,7 @@ import {
HoverCardContent,
HoverCardTrigger,
} from "@/src/components/ui/hover-card";
-import { StatusBadge } from "@/src/components/layouts/status-badge";
+import { StatusBadge } from "@/src/components/ui/StatusBadge/StatusBadge";
import { PRODUCTION_LABEL, LATEST_PROMPT_LABEL } from "@langfuse/shared";
import { cn } from "@/src/utils/tailwind";
@@ -13,7 +13,6 @@ interface TruncatedLabelsProps {
labels: string[];
maxVisibleLabels?: number;
className?: string;
- badgeClassName?: string;
showSimpleBadges?: boolean;
}
@@ -21,7 +20,6 @@ export function TruncatedLabels({
labels,
maxVisibleLabels = 5,
className,
- badgeClassName,
showSimpleBadges = false,
}: TruncatedLabelsProps) {
// Enhanced sorting: prioritize latest and production labels
@@ -53,10 +51,7 @@ export function TruncatedLabels({
showSimpleBadges ? (
<div
key={label}
- className={cn(
- "bg-secondary text-secondary-foreground max-h-fit min-h-6 w-fit content-center rounded-sm px-1 text-left text-xs font-bold",
- badgeClassName,
- )}
+ className="bg-secondary text-secondary-foreground max-h-fit min-h-6 w-fit content-center rounded-sm px-1 text-left text-xs font-bold"
>
{label}
</div>
@@ -64,7 +59,6 @@ export function TruncatedLabels({
<StatusBadge
type={label}
key={label}
- className={cn("break-all sm:break-normal", badgeClassName)}
isLive={label === PRODUCTION_LABEL}
preserveCase
/>
@@ -89,10 +83,7 @@ export function TruncatedLabels({
showSimpleBadges ? (
<div
key={label}
- className={cn(
- "bg-secondary text-secondary-foreground max-h-fit min-h-6 w-fit content-center rounded-sm px-1 text-left text-xs font-bold",
- badgeClassName,
- )}
+ className="bg-secondary text-secondary-foreground max-h-fit min-h-6 w-fit content-center rounded-sm px-1 text-left text-xs font-bold"
>
{label}
</div>
@@ -100,10 +91,6 @@ export function TruncatedLabels({
<StatusBadge
type={label}
key={label}
- className={cn(
- "break-all sm:break-normal",
- badgeClassName,
- )}
isLive={label === PRODUCTION_LABEL}
preserveCase
/>
diff --git a/web/src/components/layouts/header.tsx b/web/src/components/layouts/header.tsx
index 48ebaf047c..3df0b9b73f 100644
--- a/web/src/components/layouts/header.tsx
+++ b/web/src/components/layouts/header.tsx
@@ -1,11 +1,17 @@
import Link from "next/link";
import DocPopup from "@/src/components/layouts/doc-popup";
-import { type Status, StatusBadge } from "./status-badge";
+import { Badge } from "@/src/components/ui/badge";
+import {
+ type Status,
+ StatusBadge,
+} from "@/src/components/ui/StatusBadge/StatusBadge";
import { cn } from "@/src/utils/tailwind";
type HeaderProps = {
title: string;
status?: Status;
+ /** Plain informational badge next to the title, e.g. "Demo Org". Not a status. */
+ labelBadge?: string;
label?: {
text: string;
href: string;
@@ -66,6 +72,9 @@ function BaseHeader({ ...props }: HeaderProps & { level: "h3" | "h4" | "h5" }) {
) : null}
</div>
{props.status && <StatusBadge type={props.status} />}
+ {props.labelBadge && (
+ <Badge variant="secondary">{props.labelBadge}</Badge>
+ )}
{props.label && (
<Link href={props.label.href}>
<StatusBadge type={props.label.text} />
diff --git a/web/src/components/layouts/status-badge.tsx b/web/src/components/layouts/status-badge.tsx
deleted file mode 100644
index c70e03e733..0000000000
--- a/web/src/components/layouts/status-badge.tsx
+++ /dev/null
@@ -1,98 +0,0 @@
-import { cn } from "@/src/utils/tailwind";
-import { type ReactNode } from "react";
-
-const statusCategories = {
- active: ["production", "live", "active", "public"],
- pending: ["pending", "waiting", "queued", "running"],
- delayed: ["delayed"],
- inactive: ["disabled", "inactive"],
- paused: ["paused"],
- completed: ["completed", "done", "finished"],
- error: ["error", "failed"],
- partial: ["partial"],
-};
-
-export type Status =
- (typeof statusCategories)[keyof typeof statusCategories][number];
-
-export const StatusBadge = ({
- type,
- isLive = true,
- className,
- showText = true,
- preserveCase = false,
- children,
-}: {
- type: Status | (string & {});
- isLive?: boolean;
- className?: string;
- showText?: boolean;
- preserveCase?: boolean;
- children?: ReactNode;
-}) => {
- let badgeColor = "bg-muted-gray text-primary";
- let dotColor = "bg-muted-foreground";
- let dotPingColor = "bg-muted-foreground";
- let showDot = isLive;
-
- const normalizedType = type?.toLowerCase() ?? "";
-
- if (statusCategories.active.includes(normalizedType)) {
- badgeColor = "bg-light-green text-dark-green";
- dotColor = "animate-ping bg-dark-green";
- dotPingColor = "bg-dark-green";
- } else if (statusCategories.pending.includes(normalizedType)) {
- badgeColor = "bg-light-yellow text-dark-yellow";
- dotColor = "animate-ping bg-dark-yellow";
- dotPingColor = "bg-dark-yellow";
- } else if (statusCategories.delayed.includes(normalizedType)) {
- badgeColor = "bg-light-blue text-dark-blue";
- dotColor = "animate-ping bg-dark-blue";
- dotPingColor = "bg-dark-blue";
- } else if (statusCategories.paused.includes(normalizedType)) {
- badgeColor = "bg-light-yellow text-dark-yellow";
- dotPingColor = "bg-dark-yellow";
- } else if (statusCategories.error.includes(normalizedType)) {
- badgeColor = "bg-light-red text-dark-red";
- showDot = false;
- } else if (statusCategories.completed.includes(normalizedType)) {
- badgeColor = "bg-light-green text-dark-green";
- showDot = false;
- } else if (statusCategories.partial.includes(normalizedType)) {
- badgeColor = "bg-light-yellow text-dark-yellow";
- showDot = false;
- }
-
- return (
- <div
- className={cn(
- "inline-flex items-center gap-2 rounded-md px-2 py-1 text-xs",
- badgeColor,
- className,
- )}
- >
- {showDot && (
- <span className="relative inline-flex h-2 w-2">
- <span
- className={cn(
- "absolute inline-flex h-full w-full rounded-full opacity-75",
- dotColor,
- )}
- ></span>
- <span
- className={cn(
- "relative inline-flex h-2 w-2 rounded-full",
- dotPingColor,
- )}
- ></span>
- </span>
- )}
- {showText && type && (
- <span>
- {preserveCase ? type : type[0].toUpperCase() + type.slice(1)}
- </span>
- )}
- {children}
- </div>
- );
-};
diff --git a/web/src/components/nav/AppSidebar/AppSidebar.tsx b/web/src/components/nav/AppSidebar/AppSidebar.tsx
index 285b29c8ef..f35a95dae1 100644
--- a/web/src/components/nav/AppSidebar/AppSidebar.tsx
+++ b/web/src/components/nav/AppSidebar/AppSidebar.tsx
@@ -47,7 +47,7 @@ import {
DropdownMenuTrigger,
} from "@/src/components/ui/dropdown-menu";
import { Button } from "@/src/components/ui/button";
-import { StatusBadge } from "@/src/components/layouts/status-badge";
+import { StatusBadge } from "@/src/components/ui/StatusBadge/StatusBadge";
import { planLabels, type Plan } from "@langfuse/shared";
import {
Avatar,
@@ -605,7 +605,7 @@ const VersionLabel = ({ state }: { state: SidebarVersionState }) => {
<StatusBadge
type={backgroundMigrationStatus}
showText={false}
- className="bg-transparent"
+ variant="transparent"
/>
)}
{update && !backgroundMigrationStatus && (
@@ -654,7 +654,7 @@ const VersionLabel = ({ state }: { state: SidebarVersionState }) => {
<StatusBadge
type={backgroundMigrationStatus}
showText={false}
- className="bg-transparent"
+ variant="transparent"
/>
)}
</Link>
diff --git a/web/src/components/table/peek/peek-evaluator-config-detail.tsx b/web/src/components/table/peek/peek-evaluator-config-detail.tsx
index ff4260bdb2..6f6084c7f9 100644
--- a/web/src/components/table/peek/peek-evaluator-config-detail.tsx
+++ b/web/src/components/table/peek/peek-evaluator-config-detail.tsx
@@ -11,7 +11,7 @@ import {
} from "@/src/components/ui/tooltip";
import { V4MigrationUpdateRequiredAssistantBadge } from "@/src/features/v4-migration/V4MigrationDelayBadge";
import { UserCircle2Icon } from "lucide-react";
-import { StatusBadge } from "@/src/components/layouts/status-badge";
+import { StatusBadge } from "@/src/components/ui/StatusBadge/StatusBadge";
import { DeleteEvalConfigButton } from "@/src/components/deleteButton";
import { DeactivateEvalConfig } from "@/src/features/evals/components/deactivate-config";
import { Switch } from "@/src/components/design-system/Switch/Switch";
@@ -71,11 +71,7 @@ const PeekViewEvaluatorConfigDetail = ({
<div className="flex flex-row items-center gap-2">
<span className="max-h-fit text-lg font-bold">Configuration</span>
<div className="flex items-center gap-2">
- <StatusBadge
- type={displayStatus.toLowerCase()}
- isLive
- className="max-h-8"
- />
+ <StatusBadge type={displayStatus.toLowerCase()} isLive />
{/* Quick-deactivate is a migration aid: only shown where legacy
evals can no longer be set up (cloud), consistent with the
read-only edit gate. */}
diff --git a/web/src/components/ui/StatusBadge/StatusBadge.stories.tsx b/web/src/components/ui/StatusBadge/StatusBadge.stories.tsx
new file mode 100644
index 0000000000..1c430ad92e
--- /dev/null
+++ b/web/src/components/ui/StatusBadge/StatusBadge.stories.tsx
@@ -0,0 +1,89 @@
+import React from "react";
+import preview from "../../../../.storybook/preview";
+import { StatusBadge, type Status } from "./StatusBadge";
+
+const meta = preview.meta({
+ component: StatusBadge,
+});
+
+const representativeStatuses = [
+ "active",
+ "pending",
+ "delayed",
+ "disabled",
+ "paused",
+ "completed",
+ "error",
+ "partial",
+] satisfies Status[];
+
+const allSizes = ["default", "lg"] as const;
+
+export const Default = meta.story({
+ args: {
+ type: "active",
+ },
+});
+
+export const NotLive = meta.story({
+ args: {
+ type: "active",
+ isLive: false,
+ },
+});
+
+export const PreservedCase = meta.story({
+ args: {
+ type: "my-custom-label",
+ preserveCase: true,
+ isLive: false,
+ },
+});
+
+export const UnknownStatus = meta.story({
+ args: {
+ type: "somethingelse",
+ },
+});
+
+export const DotOnly = meta.story({
+ args: {
+ type: "active",
+ showText: false,
+ variant: "transparent",
+ },
+});
+
+export const LargeWithCustomContent = meta.story({
+ args: {
+ type: "waiting",
+ showText: false,
+ size: "lg",
+ children: "Waiting for events",
+ },
+});
+
+export const VariantMatrix = meta.story({
+ parameters: {
+ controls: {
+ disable: true,
+ },
+ },
+ render: () => (
+ <div
+ className="grid gap-4"
+ style={{ gridTemplateColumns: "repeat(2, max-content)" }}
+ >
+ {representativeStatuses.map((status) =>
+ allSizes.map((size) => (
+ <div key={`${status}-${size}`} className="flex items-center gap-3">
+ <StatusBadge type={status} size={size} />
+ <div className="text-sm">
+ {status} / {size}
+ </div>
+ </div>
+ )),
+ )}
+ </div>
+ ),
+});
diff --git a/web/src/components/ui/StatusBadge/StatusBadge.tsx b/web/src/components/ui/StatusBadge/StatusBadge.tsx
new file mode 100644
index 0000000000..59703f568f
--- /dev/null
+++ b/web/src/components/ui/StatusBadge/StatusBadge.tsx
@@ -0,0 +1,167 @@
+import { cva, type VariantProps } from "class-variance-authority";
+import { cn } from "@/src/utils/tailwind";
+import { type ReactNode } from "react";
+
+const statusBadgeVariants = cva(
+ "inline-flex items-center gap-2 rounded-md break-all sm:break-normal",
+ {
+ variants: {
+ size: {
+ default: "px-2 py-1 text-xs",
+ lg: "px-3 py-1 text-sm",
+ },
+ },
+ defaultVariants: {
+ size: "default",
+ },
+ },
+);
+
+const statusCategories = {
+ active: ["production", "live", "active", "public"],
+ pending: ["pending", "waiting", "queued", "running"],
+ delayed: ["delayed"],
+ inactive: ["disabled", "inactive"],
+ paused: ["paused"],
+ completed: ["completed", "done", "finished"],
+ error: ["error", "failed"],
+ partial: ["partial"],
+} as const;
+
+export type Status =
+ (typeof statusCategories)[keyof typeof statusCategories][number];
+
+type StatusCategory = keyof typeof statusCategories | "unknown";
+
+// Exhaustive style lookup: every CSS property is supplied by exactly one
+// branch per category, so no class merging is needed to resolve conflicts.
+const categoryStyles: Record<
+ StatusCategory,
+ {
+ background: string;
+ text: string;
+ dotOuter: string;
+ dotInner: string;
+ hideDot?: boolean;
+ }
+> = {
+ active: {
+ background: "bg-light-green",
+ text: "text-dark-green",
+ dotOuter: "animate-ping bg-dark-green",
+ dotInner: "bg-dark-green",
+ },
+ pending: {
+ background: "bg-light-yellow",
+ text: "text-dark-yellow",
+ dotOuter: "animate-ping bg-dark-yellow",
+ dotInner: "bg-dark-yellow",
+ },
+ delayed: {
+ background: "bg-light-blue",
+ text: "text-dark-blue",
+ dotOuter: "animate-ping bg-dark-blue",
+ dotInner: "bg-dark-blue",
+ },
+ inactive: {
+ background: "bg-muted-gray",
+ text: "text-primary",
+ dotOuter: "bg-muted-foreground",
+ dotInner: "bg-muted-foreground",
+ },
+ paused: {
+ background: "bg-light-yellow",
+ text: "text-dark-yellow",
+ dotOuter: "bg-muted-foreground",
+ dotInner: "bg-dark-yellow",
+ },
+ completed: {
+ background: "bg-light-green",
+ text: "text-dark-green",
+ dotOuter: "bg-muted-foreground",
+ dotInner: "bg-muted-foreground",
+ hideDot: true,
+ },
+ error: {
+ background: "bg-light-red",
+ text: "text-dark-red",
+ dotOuter: "bg-muted-foreground",
+ dotInner: "bg-muted-foreground",
+ hideDot: true,
+ },
+ partial: {
+ background: "bg-light-yellow",
+ text: "text-dark-yellow",
+ dotOuter: "bg-muted-foreground",
+ dotInner: "bg-muted-foreground",
+ hideDot: true,
+ },
+ unknown: {
+ background: "bg-muted-gray",
+ text: "text-primary",
+ dotOuter: "bg-muted-foreground",
+ dotInner: "bg-muted-foreground",
+ },
+};
+
+// preserveCase only affects rendered text, so it can only be set when the
+// text is shown.
+type StatusBadgeTextProps =
+ | { showText?: true; preserveCase?: boolean }
+ | { showText: false; preserveCase?: never };
+
+export const StatusBadge = ({
+ type,
+ variant = "default",
+ size = "default",
+ isLive = true,
+ showText = true,
+ preserveCase = false,
+ children,
+}: {
+ type: Status | (string & {});
+ variant?: "default" | "transparent";
+ isLive?: boolean;
+ children?: ReactNode;
+} & VariantProps<typeof statusBadgeVariants> &
+ StatusBadgeTextProps) => {
+ const normalizedType = type?.toLowerCase() ?? "";
+
+ const category: StatusCategory =
+ (Object.keys(statusCategories) as (keyof typeof statusCategories)[]).find(
+ (key) =>
+ (statusCategories[key] as readonly string[]).includes(normalizedType),
+ ) ?? "unknown";
+
+ const styles = categoryStyles[category];
+ const background =
+ variant === "transparent" ? "bg-transparent" : styles.background;
+ const showDot = isLive && !styles.hideDot;
+
+ return (
+ <div className={cn(statusBadgeVariants({ size }), background, styles.text)}>
+ {showDot && (
+ <span className="relative inline-flex h-2 w-2">
+ <span
+ className={cn(
+ "absolute inline-flex h-full w-full rounded-full opacity-75",
+ styles.dotOuter,
+ )}
+ ></span>
+ <span
+ className={cn(
+ "relative inline-flex h-2 w-2 rounded-full",
+ styles.dotInner,
+ )}
+ ></span>
+ </span>
+ )}
+ {showText && type && (
+ <span>
+ {preserveCase ? type : type[0].toUpperCase() + type.slice(1)}
+ </span>
+ )}
+ {children}
+ </div>
+ );
+};
diff --git a/web/src/components/ui/splash-screen.tsx b/web/src/components/ui/splash-screen.tsx
index 56869f039b..bfef16f582 100644
--- a/web/src/components/ui/splash-screen.tsx
+++ b/web/src/components/ui/splash-screen.tsx
@@ -4,7 +4,7 @@ import Image from "next/image";
import { InfoIcon } from "lucide-react";
import { ActionButton } from "@/src/components/ActionButton";
import { Alert, AlertTitle, AlertDescription } from "@/src/components/ui/alert";
-import { StatusBadge } from "@/src/components/layouts/status-badge";
+import { StatusBadge } from "@/src/components/ui/StatusBadge/StatusBadge";
export interface ValueProposition {
title: string;
@@ -109,13 +109,11 @@ export function SplashScreen({
<div className="mx-auto flex max-w-4xl flex-col items-center p-8">
<div className="mb-6 text-center">
{waitingFor && (
- <StatusBadge
- type="waiting"
- showText={false}
- className="mb-3 px-3 py-1 text-sm"
- >
- {waitingFor}
- </StatusBadge>
+ <div className="mb-3">
+ <StatusBadge type="waiting" showText={false} size="lg">
+ {waitingFor}
+ </StatusBadge>
+ </div>
)}
<h2 className="mb-2 text-2xl font-bold">{title}</h2>
{/* text-base: without a size token this fell through to the 16px
diff --git a/web/src/features/annotation-queues/components/AnnotationQueueItemsTable.tsx b/web/src/features/annotation-queues/components/AnnotationQueueItemsTable.tsx
index ebc312e8c4..d3d8c01585 100644
--- a/web/src/features/annotation-queues/components/AnnotationQueueItemsTable.tsx
+++ b/web/src/features/annotation-queues/components/AnnotationQueueItemsTable.tsx
@@ -35,7 +35,7 @@ import {
} from "@/src/components/ui/dialog";
import { Checkbox } from "@/src/components/design-system/Checkbox/Checkbox";
import { useHasProjectAccess } from "@/src/features/rbac/utils/checkProjectAccess";
-import { StatusBadge } from "@/src/components/layouts/status-badge";
+import { StatusBadge } from "@/src/components/ui/StatusBadge/StatusBadge";
import TableIdOrName from "@/src/components/table/table-id";
const QueueItemTableMultiSelectAction = ({
@@ -310,13 +310,7 @@ export function AnnotationQueueItemsTable({
size: 60,
cell: ({ row }) => {
const status: QueueItemRowData["status"] = row.getValue("status");
- return (
- <StatusBadge
- className="capitalize"
- type={status.toLowerCase()}
- isLive={false}
- />
- );
+ return <StatusBadge type={status.toLowerCase()} isLive={false} />;
},
},
{
diff --git a/web/src/features/annotation-queues/components/CreateNewAnnotationQueueItem.tsx b/web/src/features/annotation-queues/components/CreateNewAnnotationQueueItem.tsx
index 29a4ce6a2d..930df7cd8f 100644
--- a/web/src/features/annotation-queues/components/CreateNewAnnotationQueueItem.tsx
+++ b/web/src/features/annotation-queues/components/CreateNewAnnotationQueueItem.tsx
@@ -1,4 +1,4 @@
-import { StatusBadge } from "@/src/components/layouts/status-badge";
+import { StatusBadge } from "@/src/components/ui/StatusBadge/StatusBadge";
import { Button, type ButtonProps } from "@/src/components/ui/button";
import {
DropdownMenuItem,
@@ -188,11 +188,12 @@ export const CreateNewAnnotationQueueItem = ({
>
{queue.name}
{queue.status && (
- <StatusBadge
- type={queue.status.toLowerCase()}
- isLive={false}
- className="ml-2"
- />
+ <span className="ml-2">
+ <StatusBadge
+ type={queue.status.toLowerCase()}
+ isLive={false}
+ />
+ </span>
)}
</DropdownMenuCheckboxItem>
))
diff --git a/web/src/features/automations/components/AutomationExecutionsTable.tsx b/web/src/features/automations/components/AutomationExecutionsTable.tsx
index c47d453c5b..dbcb159735 100644
--- a/web/src/features/automations/components/AutomationExecutionsTable.tsx
+++ b/web/src/features/automations/components/AutomationExecutionsTable.tsx
@@ -3,7 +3,7 @@ import { api } from "@/src/utils/api";
import { DataTable } from "@/src/components/table/data-table";
import { DataTableToolbar } from "@/src/components/table/data-table-toolbar";
import { type LangfuseColumnDef } from "@/src/components/table/types";
-import { StatusBadge } from "@/src/components/layouts/status-badge";
+import { StatusBadge } from "@/src/components/ui/StatusBadge/StatusBadge";
import { IOTableCell } from "@/src/components/ui/IOTableCell";
import { useQueryParams, withDefault, NumberParam } from "use-query-params";
import { formatDistanceToNow } from "date-fns";
diff --git a/web/src/features/automations/components/AutomationSidebar.tsx b/web/src/features/automations/components/AutomationSidebar.tsx
index 515d8fe8f3..266514b6e1 100644
--- a/web/src/features/automations/components/AutomationSidebar.tsx
+++ b/web/src/features/automations/components/AutomationSidebar.tsx
@@ -2,7 +2,7 @@ import React from "react";
import { api } from "@/src/utils/api";
import { JobConfigState, type AutomationDomain } from "@langfuse/shared";
import { cn } from "@/src/utils/tailwind";
-import { StatusBadge } from "@/src/components/layouts/status-badge";
+import { StatusBadge } from "@/src/components/ui/StatusBadge/StatusBadge";
interface AutomationSidebarProps {
projectId: string;
diff --git a/web/src/features/background-migrations/components/background-migrations.tsx b/web/src/features/background-migrations/components/background-migrations.tsx
index c0f684401e..cce931490c 100644
--- a/web/src/features/background-migrations/components/background-migrations.tsx
+++ b/web/src/features/background-migrations/components/background-migrations.tsx
@@ -4,7 +4,7 @@ import { type LangfuseColumnDef } from "@/src/components/table/types";
import { api } from "@/src/utils/api";
import { type BackgroundMigration } from "@langfuse/shared";
import { RetryBackgroundMigration } from "@/src/features/background-migrations/components/retry-background-migration";
-import { StatusBadge } from "@/src/components/layouts/status-badge";
+import { StatusBadge } from "@/src/components/ui/StatusBadge/StatusBadge";
import Page from "@/src/components/layouts/page";
export default function BackgroundMigrationsTable() {
@@ -38,18 +38,18 @@ export default function BackgroundMigrationsTable() {
cell: (row) => {
const failedAt = row.row.original.failedAt;
if (failedAt) {
- return <StatusBadge type="failed" className="capitalize" />;
+ return <StatusBadge type="failed" />;
}
const finishedAt = row.row.original.finishedAt;
if (finishedAt) {
- return <StatusBadge type="finished" className="capitalize" />;
+ return <StatusBadge type="finished" />;
}
const workerId = row.row.original.workerId;
if (workerId) {
- return <StatusBadge type="active" className="capitalize" />;
+ return <StatusBadge type="active" />;
}
- return <StatusBadge type="queued" className="capitalize" />;
+ return <StatusBadge type="queued" />;
},
},
{
diff --git a/web/src/features/batch-actions/components/AddObservationsToDatasetDialog/StatusStep.tsx b/web/src/features/batch-actions/components/AddObservationsToDatasetDialog/StatusStep.tsx
index dd62d1e901..55420d6447 100644
--- a/web/src/features/batch-actions/components/AddObservationsToDatasetDialog/StatusStep.tsx
+++ b/web/src/features/batch-actions/components/AddObservationsToDatasetDialog/StatusStep.tsx
@@ -1,7 +1,7 @@
import { Button } from "@/src/components/ui/button";
import { Progress } from "@/src/components/design-system/Progress/Progress";
import { api } from "@/src/utils/api";
-import { StatusBadge } from "@/src/components/layouts/status-badge";
+import { StatusBadge } from "@/src/components/ui/StatusBadge/StatusBadge";
import { BatchActionStatus } from "@langfuse/shared";
import {
Card,
diff --git a/web/src/features/batch-actions/components/BatchActionsTable.tsx b/web/src/features/batch-actions/components/BatchActionsTable.tsx
index a613e32147..6a801f35c8 100644
--- a/web/src/features/batch-actions/components/BatchActionsTable.tsx
+++ b/web/src/features/batch-actions/components/BatchActionsTable.tsx
@@ -2,7 +2,7 @@ import { DataTable } from "@/src/components/table/data-table";
import { type LangfuseColumnDef } from "@/src/components/table/types";
import { api } from "@/src/utils/api";
import { safeExtract } from "@/src/utils/map-utils";
-import { StatusBadge } from "@/src/components/layouts/status-badge";
+import { StatusBadge } from "@/src/components/ui/StatusBadge/StatusBadge";
import { NumberParam, useQueryParams, withDefault } from "use-query-params";
import { InfoIcon } from "lucide-react";
import { Avatar, AvatarImage } from "@/src/components/ui/avatar";
@@ -75,9 +75,7 @@ export function BatchActionsTable(props: { projectId: string }) {
size: 110,
cell: ({ row }) => {
const status = row.getValue("status") as string;
- return (
- <StatusBadge type={status.toLowerCase()} className="capitalize" />
- );
+ return <StatusBadge type={status.toLowerCase()} />;
},
},
{
diff --git a/web/src/features/batch-exports/components/BatchExportsTable.tsx b/web/src/features/batch-exports/components/BatchExportsTable.tsx
index 8189b2fd3a..e0d920498b 100644
--- a/web/src/features/batch-exports/components/BatchExportsTable.tsx
+++ b/web/src/features/batch-exports/components/BatchExportsTable.tsx
@@ -3,7 +3,7 @@ import { type LangfuseColumnDef } from "@/src/components/table/types";
import { api } from "@/src/utils/api";
import { safeExtract } from "@/src/utils/map-utils";
import { type BatchExport } from "@langfuse/shared";
-import { StatusBadge } from "@/src/components/layouts/status-badge";
+import { StatusBadge } from "@/src/components/ui/StatusBadge/StatusBadge";
import { NumberParam, useQueryParams, withDefault } from "use-query-params";
import { ActionButton } from "@/src/components/ActionButton";
import { DownloadIcon, InfoIcon } from "lucide-react";
@@ -94,9 +94,7 @@ export function BatchExportsTable(props: { projectId: string }) {
size: 90,
cell: (row) => {
const status = row.getValue() as string;
- return (
- <StatusBadge type={status.toLowerCase()} className="capitalize" />
- );
+ return <StatusBadge type={status.toLowerCase()} />;
},
},
{
diff --git a/web/src/features/datasets/components/DatasetItemsTable.tsx b/web/src/features/datasets/components/DatasetItemsTable.tsx
index 8ed67d1e14..232374842e 100644
--- a/web/src/features/datasets/components/DatasetItemsTable.tsx
+++ b/web/src/features/datasets/components/DatasetItemsTable.tsx
@@ -27,7 +27,7 @@ import { useRowHeightLocalStorage } from "@/src/components/table/data-table-row-
import { IOTableCell } from "@/src/components/ui/IOTableCell";
import { usePostHogClientCapture } from "@/src/features/posthog-analytics/usePostHogClientCapture";
import useColumnOrder from "@/src/features/column-visibility/hooks/useColumnOrder";
-import { StatusBadge } from "@/src/components/layouts/status-badge";
+import { StatusBadge } from "@/src/components/ui/StatusBadge/StatusBadge";
import { useHasProjectAccess } from "@/src/features/rbac/utils/checkProjectAccess";
import { LocalIsoDate } from "@/src/components/LocalIsoDate";
import { BatchExportTableButton } from "@/src/components/BatchExportTableButton";
@@ -195,13 +195,7 @@ export function DatasetItemsTable({
size: 80,
cell: ({ row }) => {
const status: DatasetStatus = row.getValue("status");
- return (
- <StatusBadge
- className="capitalize"
- type={status.toLowerCase()}
- isLive={false}
- />
- );
+ return <StatusBadge type={status.toLowerCase()} isLive={false} />;
},
},
{
diff --git a/web/src/features/evals/components/eval-log.tsx b/web/src/features/evals/components/eval-log.tsx
index 8bf849b766..0318197a0c 100644
--- a/web/src/features/evals/components/eval-log.tsx
+++ b/web/src/features/evals/components/eval-log.tsx
@@ -1,4 +1,4 @@
-import { StatusBadge } from "@/src/components/layouts/status-badge";
+import { StatusBadge } from "@/src/components/ui/StatusBadge/StatusBadge";
import { DataTable } from "@/src/components/table/data-table";
import {
type CustomHeights,
@@ -84,10 +84,9 @@ export default function EvalLogTable({
cell: (row) => {
const status = row.getValue();
return (
- <StatusBadge
- className="w-fit self-start"
- type={status.toLowerCase()}
- />
+ <div className="w-fit self-start">
+ <StatusBadge type={status.toLowerCase()} />
+ </div>
);
},
}),
diff --git a/web/src/features/evals/components/eval-template-detail.tsx b/web/src/features/evals/components/eval-template-detail.tsx
index fabe227bd5..427abd70d9 100644
--- a/web/src/features/evals/components/eval-template-detail.tsx
+++ b/web/src/features/evals/components/eval-template-detail.tsx
@@ -17,7 +17,7 @@ import Page from "@/src/components/layouts/page";
import { Switch } from "@/src/components/design-system/Switch/Switch";
import { Command } from "@/src/components/ui/command";
import { Badge } from "@/src/components/ui/badge";
-import { StatusBadge } from "@/src/components/layouts/status-badge";
+import { StatusBadge } from "@/src/components/ui/StatusBadge/StatusBadge";
import {
SidePanel,
SidePanelContent,
@@ -207,11 +207,7 @@ export const EvalTemplateDetail = () => {
# {template.version}
</Badge>
{index === 0 && (
- <StatusBadge
- type="active"
- key="active"
- className="break-all sm:break-normal"
- />
+ <StatusBadge type="active" key="active" />
)}
</div>
<span className="text-muted-foreground text-xs">
diff --git a/web/src/features/evals/components/evaluator-detail.tsx b/web/src/features/evals/components/evaluator-detail.tsx
index 7351adc720..8f72d4b2f6 100644
--- a/web/src/features/evals/components/evaluator-detail.tsx
+++ b/web/src/features/evals/components/evaluator-detail.tsx
@@ -2,7 +2,7 @@ import * as React from "react";
import { api } from "@/src/utils/api";
import { useRouter } from "next/router";
import EvalLogTable from "@/src/features/evals/components/eval-log";
-import { StatusBadge } from "@/src/components/layouts/status-badge";
+import { StatusBadge } from "@/src/components/ui/StatusBadge/StatusBadge";
import { DetailPageNav } from "@/src/features/navigate-detail-pages/DetailPageNav";
import Page from "@/src/components/layouts/page";
import { LevelCountsDisplay } from "@/src/components/level-counts-display";
@@ -120,11 +120,7 @@ export const EvaluatorDetail = () => {
/>
</div>
)}
- <StatusBadge
- type={displayStatus.toLowerCase()}
- isLive
- className="max-h-8"
- />
+ <StatusBadge type={displayStatus.toLowerCase()} isLive />
{evaluator.data && (
<DetailPageNav
diff --git a/web/src/features/evals/components/evaluator-table.tsx b/web/src/features/evals/components/evaluator-table.tsx
index 9b09ff91cf..0a75c429ce 100644
--- a/web/src/features/evals/components/evaluator-table.tsx
+++ b/web/src/features/evals/components/evaluator-table.tsx
@@ -1,4 +1,4 @@
-import { StatusBadge } from "@/src/components/layouts/status-badge";
+import { StatusBadge } from "@/src/components/ui/StatusBadge/StatusBadge";
import { LevelCountsDisplay } from "@/src/components/level-counts-display";
import { DataTable } from "@/src/components/table/data-table";
import { DataTableToolbar } from "@/src/components/table/data-table-toolbar";
@@ -153,10 +153,9 @@ export default function EvaluatorTable({ projectId }: { projectId: string }) {
cell: (row) => {
const status = row.getValue();
return (
- <StatusBadge
- type={status.toLowerCase()}
- className={row.getValue() === "FINISHED" ? "pl-3" : ""}
- />
+ <div className={status === "FINISHED" ? "pl-3" : undefined}>
+ <StatusBadge type={status.toLowerCase()} />
+ </div>
);
},
}),
diff --git a/web/src/features/organizations/components/ProjectOverview.tsx b/web/src/features/organizations/components/ProjectOverview.tsx
index 3343da77da..afee313615 100644
--- a/web/src/features/organizations/components/ProjectOverview.tsx
+++ b/web/src/features/organizations/components/ProjectOverview.tsx
@@ -300,7 +300,9 @@ const SingleOrganizationProjectOverviewTile = ({
<Header
title={org.name}
className="truncate"
- status={orgId === env.NEXT_PUBLIC_DEMO_ORG_ID ? "Demo Org" : undefined}
+ labelBadge={
+ orgId === env.NEXT_PUBLIC_DEMO_ORG_ID ? "Demo Org" : undefined
+ }
label={
isCloudPlan(org.plan)
? {
diff --git a/web/src/features/prompts/components/ProtectedLabelsSettings.tsx b/web/src/features/prompts/components/ProtectedLabelsSettings.tsx
index e18b07bec1..fafbf18b66 100644
--- a/web/src/features/prompts/components/ProtectedLabelsSettings.tsx
+++ b/web/src/features/prompts/components/ProtectedLabelsSettings.tsx
@@ -31,7 +31,7 @@ import {
PopoverTrigger,
} from "@/src/components/ui/popover";
-import { StatusBadge } from "@/src/components/layouts/status-badge";
+import { StatusBadge } from "@/src/components/ui/StatusBadge/StatusBadge";
import {
LATEST_PROMPT_LABEL,
PRODUCTION_LABEL,
@@ -120,7 +120,6 @@ export default function ProtectedLabelsSettings({
<StatusBadge
type={label}
key={label}
- className="break-all sm:break-normal"
isLive={label === PRODUCTION_LABEL}
preserveCase
>
diff --git a/web/src/features/web-callouts/components/WebCalloutSettingsPage.tsx b/web/src/features/web-callouts/components/WebCalloutSettingsPage.tsx
index 2db82846e1..1fc9be45f9 100644
--- a/web/src/features/web-callouts/components/WebCalloutSettingsPage.tsx
+++ b/web/src/features/web-callouts/components/WebCalloutSettingsPage.tsx
@@ -6,7 +6,7 @@ import { useFieldArray, useForm } from "react-hook-form";
import { z } from "zod";
import { ActionButton } from "@/src/components/ActionButton";
-import { StatusBadge } from "@/src/components/layouts/status-badge";
+import { StatusBadge } from "@/src/components/ui/StatusBadge/StatusBadge";
import { Alert, AlertDescription, AlertTitle } from "@/src/components/ui/alert";
import { Button } from "@/src/components/ui/button";
import { Card } from "@/src/components/ui/card";
diff --git a/web/src/pages/project/[projectId]/settings/integrations/blobstorage.tsx b/web/src/pages/project/[projectId]/settings/integrations/blobstorage.tsx
index 32a6560c1c..a891a3975b 100644
--- a/web/src/pages/project/[projectId]/settings/integrations/blobstorage.tsx
+++ b/web/src/pages/project/[projectId]/settings/integrations/blobstorage.tsx
@@ -1,6 +1,6 @@
import Header from "@/src/components/layouts/header";
import ContainerPage from "@/src/components/layouts/container-page";
-import { StatusBadge } from "@/src/components/layouts/status-badge";
+import { StatusBadge } from "@/src/components/ui/StatusBadge/StatusBadge";
import { Button } from "@/src/components/ui/button";
import { Card } from "@/src/components/ui/card";
import Link from "next/link";
diff --git a/web/src/pages/project/[projectId]/settings/integrations/mixpanel.tsx b/web/src/pages/project/[projectId]/settings/integrations/mixpanel.tsx
index 326b8012ce..374e88ad2a 100644
--- a/web/src/pages/project/[projectId]/settings/integrations/mixpanel.tsx
+++ b/web/src/pages/project/[projectId]/settings/integrations/mixpanel.tsx
@@ -1,7 +1,7 @@
import { MixpanelLogo } from "@/src/components/MixpanelLogo";
import Header from "@/src/components/layouts/header";
import ContainerPage from "@/src/components/layouts/container-page";
-import { StatusBadge } from "@/src/components/layouts/status-badge";
+import { StatusBadge } from "@/src/components/ui/StatusBadge/StatusBadge";
import { Button } from "@/src/components/ui/button";
import {
Form,
diff --git a/web/src/pages/project/[projectId]/settings/integrations/posthog.tsx b/web/src/pages/project/[projectId]/settings/integrations/posthog.tsx
index 12a79a01a8..b13ddd1e85 100644
--- a/web/src/pages/project/[projectId]/settings/integrations/posthog.tsx
+++ b/web/src/pages/project/[projectId]/settings/integrations/posthog.tsx
@@ -1,7 +1,7 @@
import { PostHogLogo } from "@/src/components/PosthogLogo";
import Header from "@/src/components/layouts/header";
import ContainerPage from "@/src/components/layouts/container-page";
-import { StatusBadge } from "@/src/components/layouts/status-badge";
+import { StatusBadge } from "@/src/components/ui/StatusBadge/StatusBadge";
import { Button } from "@/src/components/ui/button";
import {
Form,
diff --git a/web/src/pages/project/[projectId]/settings/integrations/slack.tsx b/web/src/pages/project/[projectId]/settings/integrations/slack.tsx
index c2ca860743..3543d1da10 100644
--- a/web/src/pages/project/[projectId]/settings/integrations/slack.tsx
+++ b/web/src/pages/project/[projectId]/settings/integrations/slack.tsx
@@ -1,5 +1,5 @@
import ContainerPage from "@/src/components/layouts/container-page";
-import { StatusBadge } from "@/src/components/layouts/status-badge";
+import { StatusBadge } from "@/src/components/ui/StatusBadge/StatusBadge";
import { AutomationButton } from "@/src/features/automations/components/AutomationButton";
import { SlackConnectionCard } from "@/src/features/slack/components/SlackConnectionCard";
import {