"use client"; import type { ReactNode } from "react"; import Link from "@/components/routing/app-link"; import { IconExternalLink } from "@tabler/icons-react"; import { Spinner } from "@kandev/ui/spinner"; export type ChangeRequestListProps = { loading: boolean; error: string | null; emptyMessage: string; isEmpty: boolean; children: ReactNode; }; export function ChangeRequestList({ loading, error, emptyMessage, isEmpty, children, }: ChangeRequestListProps) { let content =
{children}
; if (loading) { content = (
); } else if (error) { content =
{error}
; } else if (isEmpty) { content =
{emptyMessage}
; } return
{content}
; } export type ChangeRequestRowProps = { stateIcon: ReactNode; title: string; href: string; metadata: ReactNode; taskIndicator?: ReactNode; action?: ReactNode; testId?: string; dataAttributes?: Record; }; export function ChangeRequestRow({ stateIcon, title, href, metadata, taskIndicator, action, testId, dataAttributes, }: ChangeRequestRowProps) { return (
{stateIcon}
{title}
{action ?
{action}
: null}
); }