Spaces:
Running
Running
Download apps/admin/src/components/shell/AdminHeader.tsx from Benaah/MicProtocol: direct link, hf CLI and curl.
- Browser
- Download file 1.3 kB
-
https://huggingface.co/spaces/Benaah/MicProtocol/resolve/main/apps/admin/src/components/shell/AdminHeader.tsx
- Command line
-
hf download hf://spaces/Benaah/MicProtocol/apps/admin/src/components/shell/AdminHeader.tsx
-
curl -L -o AdminHeader.tsx https://huggingface.co/spaces/Benaah/MicProtocol/resolve/main/apps/admin/src/components/shell/AdminHeader.tsx
1.3 kB
| "use client"; | |
| import React from "react"; | |
| import { RefreshCw } from "lucide-react"; | |
| import { Button } from "@micprotocol/ui"; | |
| export function AdminHeader({ | |
| title, | |
| subtitle, | |
| onRefresh, | |
| refreshing, | |
| actions, | |
| }: { | |
| title: string; | |
| subtitle?: string; | |
| onRefresh?: () => void; | |
| refreshing?: boolean; | |
| actions?: React.ReactNode; | |
| }) { | |
| return ( | |
| <header className="flex items-center justify-between gap-4 border-b border-[var(--border-color)] bg-[var(--bg-secondary)] px-6 py-4"> | |
| <div className="min-w-0"> | |
| <h1 className="font-display text-xl font-semibold text-[var(--text-primary)]">{title}</h1> | |
| {subtitle ? ( | |
| <p className="mt-0.5 truncate text-sm text-[var(--text-secondary)]">{subtitle}</p> | |
| ) : null} | |
| </div> | |
| <div className="flex items-center gap-2"> | |
| {actions} | |
| {onRefresh ? ( | |
| <Button | |
| variant="ghost" | |
| size="sm" | |
| onClick={onRefresh} | |
| disabled={refreshing} | |
| title="Refresh data" | |
| className="text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:bg-[var(--bg-tertiary)]" | |
| > | |
| <RefreshCw className={refreshing ? "animate-spin" : ""} /> | |
| </Button> | |
| ) : null} | |
| </div> | |
| </header> | |
| ); | |
| } | |