feat(ui): share resource rows and refine Node shell behavior

This commit is contained in:
Codex
2026-09-05 17:25:27 +03:00
parent d51d8bb7f6
commit 8a79dfe84d
9 changed files with 129 additions and 5 deletions
+30
View File
@@ -0,0 +1,30 @@
import type { HTMLAttributes, ReactNode } from "react";
import { cn } from "./cn.js";
export interface ResourceRowProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
title: ReactNode;
icon?: ReactNode;
description?: ReactNode;
metadata?: ReactNode;
status?: ReactNode;
actions?: ReactNode;
}
/** Compact resource presentation extracted from Mission Core AI Inference.
* Actions stay canonical controls; the row itself is not a nested button. */
export function ResourceRow({ title, icon, description, metadata, status, actions, className, ...props }: ResourceRowProps) {
return <div className={cn("nodedc-resource-row", className)} {...props}>
{icon ? <span className="nodedc-resource-row__icon" aria-hidden="true">{icon}</span> : null}
<div className="nodedc-resource-row__copy">
<strong>{title}</strong>
{description ? <span>{description}</span> : null}
{metadata ? <small>{metadata}</small> : null}
</div>
{status ? <div className="nodedc-resource-row__status">{status}</div> : null}
{actions ? <div className="nodedc-resource-row__actions">{actions}</div> : null}
</div>;
}
export function ResourceList({ className, children, ...props }: HTMLAttributes<HTMLUListElement>) {
return <ul className={cn("nodedc-resource-list", className)} {...props}>{children}</ul>;
}