diff --git a/app/(creator)/dashboard/page.tsx b/app/(creator)/dashboard/page.tsx index 0c494bc..7d0b876 100644 --- a/app/(creator)/dashboard/page.tsx +++ b/app/(creator)/dashboard/page.tsx @@ -4,6 +4,7 @@ import { Plus } from "lucide-react"; import { createFormAction } from "@/app/(creator)/actions"; import { DashboardFormBrowser } from "@/components/dashboard-form-browser"; import { EmptyState } from "@/components/empty-state"; +import { PageHeader } from "@/components/ui/page-header"; import { Button } from "@/components/ui/button"; import { getServerAuthSession } from "@/lib/auth"; import { listFormsForWorkspace } from "@/lib/forms"; @@ -38,22 +39,21 @@ export default async function DashboardPage() { return forms.length === 0 ? (
-
-
-

- {workspaceLabel} -

-

- {t("dashboard.description")} -

-
-
- -
-
+ + + + } + /> -
-
-

- {t("responseDetail.title", { - number: response.submissionNumber, - date: formatDate(response.submittedAt, locale), - })} -

-

- {workspaceLabel} -

-

- {t("responseDetail.description")} -

-
- - - -
+ + + + } + />
diff --git a/app/(creator)/forms/[id]/responses/page.tsx b/app/(creator)/forms/[id]/responses/page.tsx index 11997ce..decf297 100644 --- a/app/(creator)/forms/[id]/responses/page.tsx +++ b/app/(creator)/forms/[id]/responses/page.tsx @@ -5,6 +5,7 @@ import { notFound } from "next/navigation"; import { EmptyState } from "@/components/empty-state"; import { ResponseExportActions } from "@/components/response-export-actions"; +import { PageHeader } from "@/components/ui/page-header"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Card } from "@/components/ui/card"; @@ -99,22 +100,20 @@ export default async function ResponsesPage({ return (
-
-
-

- {form.title} -

-

- {workspaceLabel} -

-
-
- - - - -
-
+ + + + + + + } + />
diff --git a/components/dashboard-form-browser.tsx b/components/dashboard-form-browser.tsx index f22045a..0db79b8 100644 --- a/components/dashboard-form-browser.tsx +++ b/components/dashboard-form-browser.tsx @@ -15,6 +15,7 @@ import { createFormAction } from "@/app/(creator)/actions"; import { useI18n } from "@/components/i18n-provider"; import { FormStatusBadge } from "@/components/form-status-badge"; import { Button } from "@/components/ui/button"; +import { PageHeader } from "@/components/ui/page-header"; import { Card } from "@/components/ui/card"; import type { FormListItem } from "@/lib/form-types"; import { cn, formatDate } from "@/lib/utils"; @@ -123,54 +124,53 @@ export function DashboardFormBrowser({ return (
-
-
-

- {workspaceLabel} -

-

- {t("dashboard.description")} -

-
-
-
- - + +
+ + +
+
+ +
-
- -
-
-
+ } + /> {view === "grid" ? (
diff --git a/components/organization-settings-panel.tsx b/components/organization-settings-panel.tsx index 3d95619..4eeb352 100644 --- a/components/organization-settings-panel.tsx +++ b/components/organization-settings-panel.tsx @@ -15,6 +15,7 @@ import { DeleteOrganizationButton } from "@/components/delete-organization-butto import { useLocalToasts } from "@/components/use-local-toasts"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; +import { PageHeader } from "@/components/ui/page-header"; import { Input } from "@/components/ui/input"; import { Select, @@ -69,14 +70,11 @@ export function OrganizationSettingsPanel({ <>
-
-

- {t("settings.organizations.title")} -

-

- {t("settings.organizations.description")} -

-
+
-
-

- {t("settings.profile.title")} -

-

- {t("settings.profile.description")} -

-
+ diff --git a/components/settings-shell.tsx b/components/settings-shell.tsx index c53caa5..a87ee82 100644 --- a/components/settings-shell.tsx +++ b/components/settings-shell.tsx @@ -8,6 +8,7 @@ import { useI18n } from "@/components/i18n-provider"; import { OrganizationSettingsPanel } from "@/components/organization-settings-panel"; import { ProfileSettingsPanel } from "@/components/profile-settings-panel"; import { ThemeSettingsPanel } from "@/components/theme-settings-panel"; +import { PageHeader } from "@/components/ui/page-header"; import { cn } from "@/lib/utils"; import type { OrganizationSettingsSummary, @@ -57,16 +58,11 @@ export function SettingsShell({ return (
-
-
-

- {t("settings.shell.title")} -

-

- {t("settings.shell.description")} -

-
-
+
diff --git a/components/theme-settings-panel.tsx b/components/theme-settings-panel.tsx index 2ce2eb2..f883d99 100644 --- a/components/theme-settings-panel.tsx +++ b/components/theme-settings-panel.tsx @@ -4,6 +4,7 @@ import { LaptopMinimal, MoonStar, SunMedium } from "lucide-react"; import { useI18n } from "@/components/i18n-provider"; import { useThemePreference } from "@/components/theme-provider"; +import { PageHeader } from "@/components/ui/page-header"; import { cn } from "@/lib/utils"; import type { ThemePreference } from "@/lib/theme"; @@ -31,14 +32,12 @@ export function ThemeSettingsPanel() { return (
-
-

- {t("settings.appearance.title")} -

-

- {t("settings.appearance.description")} -

-
+
{options.map((option) => { diff --git a/components/ui/page-header.tsx b/components/ui/page-header.tsx new file mode 100644 index 0000000..104445a --- /dev/null +++ b/components/ui/page-header.tsx @@ -0,0 +1,82 @@ +import type { ReactNode } from "react"; + +import { cn } from "@/lib/utils"; + +type PageHeaderProps = { + title: ReactNode; + description?: ReactNode; + metadata?: ReactNode; + actions?: ReactNode; + as?: "h1" | "h2"; + className?: string; + titleClassName?: string; + descriptionClassName?: string; + metadataClassName?: string; + actionsClassName?: string; +}; + +export function PageHeader({ + title, + description, + metadata, + actions, + as = "h1", + className, + titleClassName, + descriptionClassName, + metadataClassName, + actionsClassName, +}: PageHeaderProps) { + const Title = as; + + return ( +
+
+ + {title} + + {metadata ? ( +

+ {metadata} +

+ ) : null} + {description ? ( +
+ {description} +
+ ) : null} +
+ {actions ? ( +
+ {actions} +
+ ) : null} +
+ ); +}