Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 | 12x 12x 12x 12x 12x 10x 2x 2x 2x 2x 2x 11x 21x 21x 21x 21x 21x 21x 21x 21x 21x 3x 3x 3x 3x 3x 3x 2x 2x 2x 2x 2x 21x 1x 1x 1x 21x 123x 21x 101x 21x 1x 3x 3x 27x 206x 206x 206x 206x 206x 206x 206x 206x 206x 206x 206x 206x 206x 39x 36x 36x 36x 36x 36x 36x 36x 36x 33x 33x 36x 36x 1x 206x 3x 3x 3x 3x 3x 2x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 3x 206x 410x 7x 1x 87x 87x 87x 15x 230x 41x 27x 32x | "use client";
import { fetchApi } from "@/lib/api";
import { useCallback, useEffect, useState } from "react";
import {
Loader2,
Upload,
Database,
CheckCircle2,
ChevronDown,
ChevronUp,
ChevronRight,
FileJson2,
Copy,
Network,
Activity,
} from "lucide-react";
import PageIntro from "@/components/PageIntro";
import FhirResourceViewer from "@/components/FhirResourceViewer";
interface ParticipantCtx {
"@id": string;
identity: string;
state: string;
}
interface Asset {
"@id": string;
"edc:name"?: string;
"edc:description"?: string;
"edc:contenttype"?: string;
name?: string;
description?: string;
contenttype?: string;
properties?: {
name?: string;
description?: string;
contenttype?: string;
[key: string]: unknown;
};
[key: string]: unknown;
}
type Tab = "existing" | "create";
/* ── Collapsible JSON Tree (syntax-highlighted) ── */
function JsonNode({ data, depth = 0 }: { data: unknown; depth?: number }) {
const [collapsed, setCollapsed] = useState(depth > 1);
Iif (data === null || data === undefined) {
return <span className="text-[var(--text-secondary)]">null</span>;
}
Iif (typeof data === "boolean") {
return <span className="text-[var(--role-hdab-text)]">{String(data)}</span>;
}
Iif (typeof data === "number") {
return <span className="text-[var(--role-holder-text)]">{data}</span>;
}
if (typeof data === "string") {
return (
<span className="text-[var(--role-user-text)]">"{data}"</span>
);
}
Iif (Array.isArray(data)) {
if (data.length === 0)
return <span className="text-[var(--text-secondary)]">[]</span>;
return (
<span>
<button
onClick={() => setCollapsed(!collapsed)}
className="text-[var(--text-secondary)] hover:text-[var(--text-primary)] inline-flex items-center"
>
{collapsed ? <ChevronRight size={12} /> : <ChevronDown size={12} />}
<span className="text-[var(--text-secondary)] text-xs ml-0.5">
[{data.length}]
</span>
</button>
{!collapsed && (
<div className="ml-4 border-l border-[var(--border)] pl-2">
{data.map((item, i) => (
<div key={i}>
<span className="text-gray-600 text-xs mr-1">{i}:</span>
<JsonNode data={item} depth={depth + 1} />
</div>
))}
</div>
)}
</span>
);
}
Eif (typeof data === "object") {
const entries = Object.entries(data as Record<string, unknown>);
Iif (entries.length === 0) {
return <span className="text-[var(--text-secondary)]">{"{}"}</span>;
}
return (
<span>
<button
onClick={() => setCollapsed(!collapsed)}
className="text-[var(--text-secondary)] hover:text-[var(--text-primary)] inline-flex items-center"
>
{collapsed ? <ChevronRight size={12} /> : <ChevronDown size={12} />}
<span className="text-[var(--text-secondary)] text-xs ml-0.5">
{"{"}
{entries.length}
{"}"}
</span>
</button>
{!collapsed && (
<div className="ml-4 border-l border-[var(--border)] pl-2">
{entries.map(([key, val]) => (
<div key={key}>
<span className="text-[var(--accent)]">{key}</span>
<span className="text-[var(--text-secondary)]">: </span>
<JsonNode data={val} depth={depth + 1} />
</div>
))}
</div>
)}
</span>
);
}
return <span>{String(data)}</span>;
}
/* ── Asset Detail Panel ── */
function AssetDetailPanel({ asset }: { asset: Asset }) {
const [viewMode, setViewMode] = useState<"details" | "json" | "fhir">(
"details",
);
const [copied, setCopied] = useState(false);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const [fhirBundle, setFhirBundle] = useState<any>(null);
const [fhirLoading, setFhirLoading] = useState(false);
const name =
asset.name || asset["edc:name"] || asset.properties?.name || asset["@id"];
const desc =
asset.description ||
asset["edc:description"] ||
asset.properties?.description;
const ct =
asset.contenttype ||
asset["edc:contenttype"] ||
asset.properties?.contenttype;
const isFhir = String(ct ?? "").includes("fhir");
// Load FHIR bundle when switching to fhir tab
const loadFhirBundle = useCallback(async () => {
Iif (fhirBundle || fhirLoading) return;
setFhirLoading(true);
try {
// Try to match asset ID to a known FHIR bundle key
const assetId = String(asset["@id"] ?? "");
const bundleKey =
assetId || name?.toString().toLowerCase().replace(/\s+/g, "-");
const res = await fetch("/mock/fhir_bundles.json");
Eif (res.ok) {
const bundles = await res.json();
// Try exact match, then prefix match
const bundle =
bundles[bundleKey] ??
bundles[assetId.replace(/^asset:/, "")] ??
Object.values(bundles).find(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(b: any) => b?.resourceType === "Bundle",
);
if (bundle) setFhirBundle(bundle);
}
} catch {
/* ignore — FHIR data unavailable */
} finally {
setFhirLoading(false);
}
}, [fhirBundle, fhirLoading, asset, name]);
const copyJson = useCallback(() => {
navigator.clipboard.writeText(JSON.stringify(asset, null, 2));
setCopied(true);
setTimeout(() => setCopied(false), 2000);
}, [asset]);
// Collect extra properties (skip already-displayed ones)
const skipKeys = new Set([
"@id",
"@type",
"name",
"description",
"contenttype",
"edc:name",
"edc:description",
"edc:contenttype",
"properties",
]);
const extraEntries = Object.entries(asset).filter(([k]) => !skipKeys.has(k));
const propEntries = asset.properties
? Object.entries(asset.properties).filter(
([k]) => !["name", "description", "contenttype"].includes(k),
)
: [];
return (
<div className="border-t border-layer2/30 bg-[var(--surface)]/80">
{/* Header */}
<div className="flex items-center justify-between px-4 py-2 bg-layer2/10 border-b border-layer2/30">
<div className="flex items-center gap-2">
<FileJson2 size={14} className="text-teal-800 dark:text-teal-300" />
<span className="text-xs font-medium text-[var(--text-primary)]">
Asset Details — {name}
</span>
</div>
<div className="flex items-center gap-2">
<a
href={`/graph?highlight=${encodeURIComponent(String(name))}`}
className="flex items-center gap-1 text-[11px] text-[var(--accent)] hover:underline transition-colors"
>
View in Graph <Network size={10} />
</a>
</div>
</div>
{/* Summary metadata */}
<div className="px-4 py-3 border-b border-[var(--border)] grid grid-cols-2 sm:grid-cols-4 gap-3">
<div>
<div className="text-[10px] text-[var(--text-secondary)] uppercase tracking-wide">
Asset ID
</div>
<div className="text-sm text-[var(--text-primary)] font-mono truncate">
{asset["@id"]}
</div>
</div>
<div>
<div className="text-[10px] text-[var(--text-secondary)] uppercase tracking-wide">
Type
</div>
<div className="text-sm text-[var(--text-primary)]">
{String(asset["@type"] || "Asset")}
</div>
</div>
<div>
<div className="text-[10px] text-[var(--text-secondary)] uppercase tracking-wide">
Content Type
</div>
<div className="text-sm text-[var(--text-primary)]">{ct || "—"}</div>
</div>
<div>
<div className="text-[10px] text-[var(--text-secondary)] uppercase tracking-wide">
Properties
</div>
<div className="text-sm text-[var(--text-primary)]">
{Object.keys(asset.properties || {}).length} fields
</div>
</div>
</div>
{/* Description */}
{desc && (
<div className="px-4 py-2 border-b border-[var(--border)]">
<div className="text-[10px] text-[var(--text-secondary)] uppercase tracking-wide mb-1">
Description
</div>
<p className="text-xs text-[var(--text-primary)]">{desc as string}</p>
</div>
)}
{/* View mode tabs & copy */}
<div className="px-4 py-2 border-b border-[var(--border)] flex items-center justify-between">
<div className="flex gap-1">
<button
onClick={() => setViewMode("details")}
className={`text-xs px-2.5 py-1 rounded ${
viewMode === "details"
? "bg-layer2/20 text-teal-800 dark:text-teal-300"
: "text-[var(--text-secondary)] hover:text-[var(--text-primary)]"
}`}
>
Details
</button>
<button
onClick={() => setViewMode("json")}
className={`text-xs px-2.5 py-1 rounded ${
viewMode === "json"
? "bg-layer2/20 text-teal-800 dark:text-teal-300"
: "text-[var(--text-secondary)] hover:text-[var(--text-primary)]"
}`}
>
Raw JSON
</button>
{isFhir && (
<button
onClick={() => {
setViewMode("fhir");
loadFhirBundle();
}}
className={`text-xs px-2.5 py-1 rounded inline-flex items-center gap-1 ${
viewMode === "fhir"
? "bg-[var(--role-user-bg)] text-[var(--role-user-text)]"
: "text-[var(--text-secondary)] hover:text-[var(--text-primary)]"
}`}
>
<Activity size={10} />
FHIR Viewer
</button>
)}
</div>
<button
onClick={copyJson}
className="flex items-center gap-1 text-[11px] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"
>
<Copy size={10} />
{copied ? "Copied!" : "Copy"}
</button>
</div>
{/* Content */}
<div className="max-h-[500px] overflow-y-auto">
{viewMode === "fhir" ? (
<div className="p-4">
{fhirLoading ? (
<div className="flex items-center gap-2 text-[var(--text-secondary)] py-6 justify-center">
<Loader2 size={14} className="animate-spin" />
Loading FHIR bundle…
</div>
) : fhirBundle ? (
<FhirResourceViewer
bundle={fhirBundle}
title={`FHIR Resources — ${name}`}
/>
) : (
<p className="text-[var(--text-secondary)] text-xs text-center py-6">
No FHIR bundle data available for this asset.
</p>
)}
</div>
) : viewMode === "details" ? (
<div className="p-4 space-y-3">
{/* Extra top-level properties */}
{extraEntries.length > 0 && (
<div>
<div className="text-[10px] text-[var(--text-secondary)] uppercase tracking-wide mb-1.5">
EDC Metadata
</div>
<div className="space-y-1 font-mono text-xs">
{extraEntries.map(([k, v]) => (
<div key={k} className="flex gap-2">
<span className="text-[var(--accent)] shrink-0">
{k}:
</span>
<span className="text-[var(--role-user-text)] truncate">
{typeof v === "string" ? v : JSON.stringify(v)}
</span>
</div>
))}
</div>
</div>
)}
{/* Nested properties */}
{propEntries.length > 0 && (
<div>
<div className="text-[10px] text-[var(--text-secondary)] uppercase tracking-wide mb-1.5">
Properties
</div>
<div className="space-y-1 font-mono text-xs">
{propEntries.map(([k, v]) => (
<div key={k} className="flex gap-2">
<span className="text-[var(--accent)] shrink-0">
{k}:
</span>
<span className="text-[var(--role-user-text)] truncate">
{typeof v === "string" ? v : JSON.stringify(v)}
</span>
</div>
))}
</div>
</div>
)}
</div>
) : (
<div className="p-4 font-mono text-xs">
<JsonNode data={asset} depth={0} />
</div>
)}
</div>
</div>
);
}
export default function DataSharePage() {
const [tab, setTab] = useState<Tab>("existing");
const [participants, setParticipants] = useState<ParticipantCtx[]>([]);
const [assets, setAssets] = useState<Asset[]>([]);
const [loading, setLoading] = useState(true);
const [expanded, setExpanded] = useState<string | null>(null);
// Form state
const [selectedCtx, setSelectedCtx] = useState("");
const [assetName, setAssetName] = useState("");
const [assetDesc, setAssetDesc] = useState("");
const [contentType, setContentType] = useState("application/fhir+json");
const [baseUrl, setBaseUrl] = useState("");
const [creating, setCreating] = useState(false);
const [createResult, setCreateResult] = useState<string | null>(null);
useEffect(() => {
Promise.all([
fetchApi("/api/participants").then((r) => (r.ok ? r.json() : [])),
fetchApi("/api/assets").then((r) => (r.ok ? r.json() : [])),
])
.then(([ctx, assetData]) => {
// /api/participants returns flat array or { participants: [...] }
const list: ParticipantCtx[] = Array.isArray(ctx)
? ctx
: ctx.participants || [];
setParticipants(list);
if (list.length > 0) setSelectedCtx(list[0]["@id"]);
// /api/assets returns flat array of {participantId, identity, assets[]} or { participants: [...] }
const groups = Array.isArray(assetData)
? assetData
: assetData.participants || [];
const allAssets: Asset[] = [];
for (const p of groups) {
Eif (Array.isArray(p.assets)) {
allAssets.push(...p.assets);
}
}
setAssets(allAssets);
setLoading(false);
})
.catch(() => setLoading(false));
}, []);
const handleCreate = async (e: React.FormEvent) => {
e.preventDefault();
setCreating(true);
setCreateResult(null);
try {
const res = await fetchApi("/api/assets", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
participantId: selectedCtx,
name: assetName,
description: assetDesc,
contentType,
baseUrl,
}),
});
if (res.ok) {
setCreateResult("Asset created successfully!");
setAssetName("");
setAssetDesc("");
setBaseUrl("");
// Refresh asset list
const updated = await fetchApi(
`/api/assets?participantId=${selectedCtx}`,
);
const data = await updated.json();
setAssets(Array.isArray(data.assets) ? data.assets : []);
} else {
const err = await res.json();
setCreateResult(`Error: ${err.error || "Creation failed"}`);
}
} catch {
setCreateResult("Error: Failed to create asset");
} finally {
setCreating(false);
}
};
return (
<div className="min-h-screen bg-[var(--bg)]">
<div className="max-w-5xl mx-auto px-6 py-10">
<PageIntro
title="Share Data"
icon={Upload}
description="Register data assets for sharing in the EHDS dataspace. Define FHIR or OMOP datasets with their access policies, then publish them so other participants can discover and negotiate access."
prevStep={{ href: "/credentials", label: "Verifiable Credentials" }}
nextStep={{ href: "/data/discover", label: "Discover Data" }}
infoText="Each data asset is registered via the EDC-V management API with an ODRL policy. The asset becomes visible in the federated catalog once published."
docLink={{ href: "/docs/developer", label: "Developer Guide" }}
/>
{/* Tabs */}
<div className="flex gap-1 mb-6 border-b border-[var(--border)]">
{(["existing", "create"] as Tab[]).map((t) => (
<button
key={t}
onClick={() => setTab(t)}
className={`px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors ${
tab === t
? "border-layer2 text-teal-800 dark:text-teal-300"
: "border-transparent text-[var(--text-secondary)] hover:text-[var(--text-primary)]"
}`}
>
{t === "existing" ? "My Assets" : "Register New"}
</button>
))}
</div>
{tab === "existing" ? (
loading ? (
<div className="flex items-center gap-2 text-[var(--text-secondary)]">
<Loader2 size={16} className="animate-spin" />
Loading assets…
</div>
) : assets.length === 0 ? (
<div className="text-center py-12">
<Database size={40} className="text-gray-600 mx-auto mb-4" />
<p className="text-[var(--text-secondary)]">
No data assets registered yet
</p>
<button
onClick={() => setTab("create")}
className="mt-3 text-sm text-teal-800 dark:text-teal-300 hover:underline"
>
Register your first asset →
</button>
</div>
) : (
<div className="grid gap-3">
{assets.map((a) => {
const id = a["@id"] || String(Math.random());
const isOpen = expanded === id;
return (
<div
key={id}
className={`border rounded-xl transition-colors ${
isOpen
? "border-layer2 bg-[var(--surface)]/60"
: "border-[var(--border)] hover:border-layer2"
}`}
>
<button
className="w-full text-left p-4"
aria-label={`${isOpen ? "Collapse" : "Expand"} ${
a.name ||
a["edc:name"] ||
a.properties?.name ||
a["@id"]
}`}
onClick={() => setExpanded(isOpen ? null : id)}
>
<div className="flex items-center justify-between">
<div>
<p className="font-medium text-sm text-teal-800 dark:text-teal-300">
{a.name ||
a["edc:name"] ||
a.properties?.name ||
a["@id"]}
</p>
{(a.description ||
a["edc:description"] ||
a.properties?.description) && (
<p className="text-xs text-[var(--text-secondary)] mt-0.5 line-clamp-1">
{
(a.description ||
a["edc:description"] ||
a.properties?.description) as string
}
</p>
)}
</div>
<div className="flex items-center gap-2">
{(a.contenttype ||
a["edc:contenttype"] ||
a.properties?.contenttype) && (
<span className="text-xs bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-gray-200 px-2 py-0.5 rounded-full">
{
(a.contenttype ||
a["edc:contenttype"] ||
a.properties?.contenttype) as string
}
</span>
)}
{isOpen ? (
<ChevronUp
size={16}
className="text-[var(--text-secondary)]"
/>
) : (
<ChevronDown
size={16}
className="text-[var(--text-secondary)]"
/>
)}
</div>
</div>
</button>
{isOpen && <AssetDetailPanel asset={a} />}
</div>
);
})}
</div>
)
) : (
/* Create new asset form */
<div className="border border-[var(--border)] rounded-xl p-6">
<div className="flex items-center gap-2 mb-6">
<Upload size={18} className="text-teal-800 dark:text-teal-300" />
<h2 className="font-semibold text-sm">Register Data Asset</h2>
</div>
{createResult && (
<div
className={`mb-4 p-3 rounded text-sm ${
createResult.startsWith("Error")
? "bg-[var(--role-admin-bg)] border border-[var(--role-admin-border)] text-[var(--role-admin-text)]"
: "bg-[var(--role-user-bg)] border border-[var(--role-user-border)] text-[var(--role-user-text)]"
}`}
>
{createResult.startsWith("Error") ? null : (
<CheckCircle2 size={14} className="inline mr-1" />
)}
{createResult}
</div>
)}
<form onSubmit={handleCreate} className="space-y-4">
<div>
<label className="text-xs text-[var(--text-secondary)] mb-1 block">
Participant Context
</label>
<select
aria-label="Participant Context"
value={selectedCtx}
onChange={(e) => setSelectedCtx(e.target.value)}
className="w-full px-3 py-2 bg-[var(--surface-2)] border border-gray-600 rounded text-sm"
>
{participants.map((p) => (
<option key={p["@id"]} value={p["@id"]}>
{p.identity
?.replace("did:web:", "")
.replace(/%3A/g, ":") || p["@id"].slice(0, 16)}
</option>
))}
</select>
</div>
<div className="grid sm:grid-cols-2 gap-4">
<div>
<label className="text-xs text-[var(--text-secondary)] mb-1 block">
Asset Name
</label>
<input
aria-label="Asset Name"
type="text"
required
value={assetName}
onChange={(e) => setAssetName(e.target.value)}
placeholder="e.g. fhir-patient-cohort"
className="w-full px-3 py-2 bg-[var(--surface-2)] border border-gray-600 rounded text-sm outline-none focus:border-layer2"
/>
</div>
<div>
<label className="text-xs text-[var(--text-secondary)] mb-1 block">
Content Type
</label>
<select
aria-label="Content Type"
value={contentType}
onChange={(e) => setContentType(e.target.value)}
className="w-full px-3 py-2 bg-[var(--surface-2)] border border-gray-600 rounded text-sm"
>
<option value="application/fhir+json">
FHIR R4 (application/fhir+json)
</option>
<option value="application/json">JSON</option>
<option value="text/csv">CSV</option>
<option value="application/x-ndjson">NDJSON</option>
</select>
</div>
</div>
<div>
<label className="text-xs text-[var(--text-secondary)] mb-1 block">
Description
</label>
<textarea
value={assetDesc}
onChange={(e) => setAssetDesc(e.target.value)}
rows={2}
placeholder="Describe the dataset…"
className="w-full px-3 py-2 bg-[var(--surface-2)] border border-gray-600 rounded text-sm outline-none focus:border-layer2"
/>
</div>
<div>
<label className="text-xs text-[var(--text-secondary)] mb-1 block">
Data Source URL
</label>
<input
aria-label="Data Source URL"
type="url"
value={baseUrl}
onChange={(e) => setBaseUrl(e.target.value)}
placeholder="https://fhir-server/Patient"
className="w-full px-3 py-2 bg-[var(--surface-2)] border border-gray-600 rounded text-sm outline-none focus:border-layer2"
/>
</div>
<button
type="submit"
disabled={creating}
className="flex items-center gap-2 px-5 py-2.5 bg-[var(--accent)] text-white dark:text-gray-900 rounded-lg text-sm font-medium hover:bg-[var(--accent-hover)] disabled:opacity-50"
>
{creating ? (
<Loader2 size={16} className="animate-spin" />
) : (
<Upload size={16} />
)}
Register Asset
</button>
</form>
</div>
)}
</div>
</div>
);
}
|