Initial CMPP frontend prototype

This commit is contained in:
hectorzhao
2026-06-30 16:09:46 +08:00
commit 2f3c274a30
98 changed files with 25255 additions and 0 deletions
+62
View File
@@ -0,0 +1,62 @@
import type { ReactNode } from 'react';
import { Button } from '@/components/ui/Button';
type QueryPanelProps = {
title: ReactNode;
summary?: ReactNode;
children: ReactNode;
};
type PaginationProps = {
total: number;
page?: number;
previousDisabled?: boolean;
nextDisabled?: boolean;
onPrevious?: () => void;
onNext?: () => void;
};
type InlineTextPreviewProps = {
label: ReactNode;
leading?: ReactNode;
children: ReactNode;
};
export function QueryPanel({ title, summary, children }: QueryPanelProps) {
return (
<div className="surface ui-query-panel">
<h2>{title}</h2>
<div className="ui-query-panel__grid">{children}</div>
{summary ? <p className="ui-query-panel__summary">{summary}</p> : null}
</div>
);
}
export function Pagination({
total,
page = 1,
previousDisabled = true,
nextDisabled = true,
onPrevious,
onNext,
}: PaginationProps) {
return (
<div className="ui-pagination">
<span> {total} </span>
<div>
<Button disabled={previousDisabled} onClick={onPrevious} size="sm" variant="ghost"></Button>
<Button size="sm" variant="secondary">{page}</Button>
<Button disabled={nextDisabled} onClick={onNext} size="sm" variant="ghost"></Button>
</div>
</div>
);
}
export function InlineTextPreview({ label, leading, children }: InlineTextPreviewProps) {
return (
<div className="ui-inline-text-preview">
<span>{label}</span>
<p>{leading}{children}</p>
</div>
);
}