Files
devdash-cli/src/ui/components/cards.py
7000pctAUTO d79237861f
Some checks failed
CI / test (push) Has been cancelled
Initial upload: DevDash CLI with TUI dashboard
2026-02-01 06:52:59 +00:00

30 lines
885 B
Python

from textual.widgets import Static, Label
from textual.containers import Container
from typing import List, Optional
class PullRequestCard(Container):
def __init__(
self,
title: str,
author: str,
number: int,
draft: bool = False,
labels: List[str] = None,
**kwargs
):
super().__init__(**kwargs)
self.title = title
self.author = author
self.number = number
self.draft = draft
self.labels = labels or []
def compose(self) -> ComposeResult:
yield Label(f"PR #{self.number}: {self.title}", classes="pr-title")
yield Static(f"by {self.author}", classes="pr-author")
if self.labels:
yield Static(f"Labels: {', '.join(self.labels)}", classes="pr-labels")
if self.draft:
yield Static("[DRAFT]", classes="draft-badge")