This repository was archived by the owner on Mar 16, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDAOTabLayout.tsx
More file actions
81 lines (77 loc) · 2.35 KB
/
DAOTabLayout.tsx
File metadata and controls
81 lines (77 loc) · 2.35 KB
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
"use client";
import type React from "react";
interface DAOTabLayoutProps {
title?: string;
description?: string;
icon?: React.ElementType;
toolbar?: React.ReactNode;
children: React.ReactNode;
isEmpty?: boolean;
emptyTitle?: string;
emptyDescription?: string;
emptyIcon?: React.ElementType;
}
export function DAOTabLayout({
title,
description,
icon: Icon,
toolbar,
children,
isEmpty = false,
emptyTitle,
emptyDescription,
emptyIcon: EmptyIcon,
}: DAOTabLayoutProps) {
return (
<div className="mx-auto space-y-4 rounded-sm">
{/* Header Section */}
<div className="space-y-2 px-2">
<div className="flex items-center gap-3 px-2">
{Icon && (
<div className="w-10 h-10 rounded-sm bg-gradient-to-br from-secondary/20 to-secondary/10 flex items-center justify-center">
<Icon className="h-5 w-5 text-secondary" />
</div>
)}
<div>
<h2 className="text-2xl font-bold tracking-tight text-foreground">
{title}
</h2>
{description && (
<p className="text-muted-foreground mt-1">{description}</p>
)}
</div>
</div>
{/* Toolbar Section */}
{toolbar && (
<div className="flex flex-col space-y-4 sm:flex-row sm:items-center sm:justify-between sm:space-y-0">
{toolbar}
</div>
)}
</div>
{/* Content Section */}
<div className="space-y-4">
{isEmpty ? (
<div className=" ">
<div className="text-center space-y-4">
{EmptyIcon && (
<div className="w-12 h-12 rounded-sm bg-muted/50 flex items-center justify-center mx-auto">
<EmptyIcon className="h-6 w-6 text-muted-foreground" />
</div>
)}
<div className="space-y-2">
<h3 className="text-lg font-medium text-foreground">
{emptyTitle || "No Data Found"}
</h3>
<p className="text-sm text-muted-foreground max-w-md mx-auto">
{emptyDescription || "No data available for this section."}
</p>
</div>
</div>
</div>
) : (
<div className="bg-card/30">{children}</div>
)}
</div>
</div>
);
}