feat(HAI-002): build header and toast components
This commit is contained in:
17
packages/dashboard/app/components/Header.tsx
Normal file
17
packages/dashboard/app/components/Header.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
interface HeaderProps {
|
||||
onNewTask: () => void;
|
||||
}
|
||||
|
||||
export function Header({ onNewTask }: HeaderProps) {
|
||||
return (
|
||||
<header className="header">
|
||||
<div className="header-left">
|
||||
<h1 className="logo">hai</h1>
|
||||
<span className="logo-sub">board</span>
|
||||
</div>
|
||||
<button className="btn btn-primary" onClick={onNewTask}>
|
||||
+ New Task
|
||||
</button>
|
||||
</header>
|
||||
);
|
||||
}
|
||||
18
packages/dashboard/app/components/ToastContainer.tsx
Normal file
18
packages/dashboard/app/components/ToastContainer.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { Toast } from "../hooks/useToast";
|
||||
|
||||
interface ToastContainerProps {
|
||||
toasts: Toast[];
|
||||
onRemove: (id: number) => void;
|
||||
}
|
||||
|
||||
export function ToastContainer({ toasts }: ToastContainerProps) {
|
||||
return (
|
||||
<div className="toast-container" id="toasts">
|
||||
{toasts.map((toast) => (
|
||||
<div key={toast.id} className={`toast toast-${toast.type}`}>
|
||||
{toast.message}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user