feat: connect resource library workflows

This commit is contained in:
afei A
2026-03-28 13:42:22 +08:00
parent c604e6ace1
commit 162d3e12d2
42 changed files with 4709 additions and 305 deletions

View File

@@ -6,6 +6,7 @@ import {
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Select } from "@/components/ui/select";
import type { ResourcePickerOption } from "@/features/orders/resource-picker-options";
type ResourcePickerCardProps = {
@@ -19,10 +20,6 @@ type ResourcePickerCardProps = {
onChange: (value: string) => void;
};
function joinClasses(...values: Array<string | false | null | undefined>) {
return values.filter(Boolean).join(" ");
}
export function ResourcePickerCard({
description,
disabled = false,
@@ -45,25 +42,18 @@ export function ResourcePickerCard({
<CardContent className="space-y-4">
<label className="flex flex-col gap-2 text-sm text-[var(--ink-strong)]">
<span className="font-medium">{label}</span>
<select
<Select
aria-label={label}
className={joinClasses(
"min-h-12 rounded-[18px] border border-[var(--border-strong)] bg-[var(--surface-muted)] px-4 text-sm text-[var(--ink-strong)]",
"focus:outline-none focus:ring-2 focus:ring-[var(--accent-ring)]",
)}
className="min-h-12 rounded-[18px] border-[var(--border-strong)] bg-[var(--surface-muted)] px-4"
disabled={disabled || isLoading}
options={items.map((item) => ({
value: item.id,
label: item.name,
}))}
placeholder={isLoading ? "正在加载占位资源..." : "请选择一个资源"}
value={value}
onChange={(event) => onChange(event.target.value)}
>
<option value="">
{isLoading ? "正在加载占位资源..." : "请选择一个资源"}
</option>
{items.map((item) => (
<option key={item.id} value={item.id}>
{item.name}
</option>
))}
</select>
onValueChange={onChange}
/>
</label>
{selectedItem ? (