diff --git a/webui2/src/components/bugs/BugRow.stories.tsx b/webui2/src/components/bugs/BugRow.stories.tsx deleted file mode 100644 index 99c9beb9917d7050155e97923e30a11983aeb65a..0000000000000000000000000000000000000000 --- a/webui2/src/components/bugs/BugRow.stories.tsx +++ /dev/null @@ -1,74 +0,0 @@ -import type { Meta, StoryObj } from "@storybook/react-vite"; - -import { Status } from "@/__generated__/graphql"; -import { withRouter } from "@/../.storybook/decorators"; - -import { BugRow } from "./BugRow"; - -const meta = { - component: BugRow, - decorators: [withRouter], -} satisfies Meta; - -export default meta; -type Story = StoryObj; - -const baseArgs = { - id: "abc123", - humanId: "a1b2c3", - repo: "my-repo", - author: { - humanId: "user1", - displayName: "Jane Doe", - avatarUrl: null, - }, - createdAt: new Date(Date.now() - 3600 * 1000).toISOString(), -}; - -export const OpenBug: Story = { - args: { - ...baseArgs, - status: Status.Open, - title: "Fix login page crash on empty email", - labels: [ - { name: "bug", color: { R: 252, G: 41, B: 41 } }, - { name: "priority", color: { R: 255, G: 152, B: 0 } }, - ], - commentCount: 3, - }, -}; - -export const ClosedBug: Story = { - args: { - ...baseArgs, - status: Status.Closed, - title: "Add dark mode support", - labels: [{ name: "enhancement", color: { R: 163, G: 230, B: 53 } }], - commentCount: 12, - }, -}; - -export const NoLabels: Story = { - args: { - ...baseArgs, - status: Status.Open, - title: "Simple bug with no labels", - labels: [], - commentCount: 0, - }, -}; - -export const LongTitle: Story = { - args: { - ...baseArgs, - status: Status.Open, - title: - "This is a very long bug title that should demonstrate how the component handles overflow and wrapping when the title extends beyond the available space", - labels: [ - { name: "bug", color: { R: 252, G: 41, B: 41 } }, - { name: "documentation", color: { R: 30, G: 80, B: 160 } }, - { name: "help wanted", color: { R: 0, G: 150, B: 136 } }, - ], - commentCount: 42, - }, -}; diff --git a/webui2/src/components/bugs/BugRow.tsx b/webui2/src/components/bugs/BugRow.tsx deleted file mode 100644 index 5d58e1226bfd3f60591ccb5ead0af3b1456eabfd..0000000000000000000000000000000000000000 --- a/webui2/src/components/bugs/BugRow.tsx +++ /dev/null @@ -1,85 +0,0 @@ -import { Link } from "@tanstack/react-router"; -import { formatDistanceToNow } from "date-fns"; -import { MessageSquare, CircleDot, CircleCheck } from "lucide-react"; - -import { Status } from "@/__generated__/graphql"; - -import { LabelBadge } from "./LabelBadge"; - -interface BugRowProps { - id: string; - humanId: string; - status: Status; - title: string; - labels: Array<{ name: string; color: { R: number; G: number; B: number } }>; - author: { humanId: string; displayName: string; avatarUrl?: string | null }; - createdAt: string; - commentCount: number; - repo: string; -} - -// Single row in the issue list. Shows status icon, title, labels, author and -// comment count. -/** @deprecated Use IssueRow composition components instead. */ -export function BugRow({ - humanId, - status, - title, - labels, - author, - createdAt, - commentCount, - repo, -}: BugRowProps) { - const isOpen = status === Status.Open; - const StatusIcon = isOpen ? CircleDot : CircleCheck; - - return ( -
- - -
-
- - {title} - - {labels.map((label) => ( - - ))} -
-

- #{humanId} opened {formatDistanceToNow(new Date(createdAt), { addSuffix: true })} by{" "} - - {author.displayName} - -

-
- - {commentCount > 0 && ( -
- - {commentCount} -
- )} -
- ); -}