feat: refresh dashboards experience
This commit is contained in:
parent
1900f65e5e
commit
d7d6b748cc
9 changed files with 1626 additions and 281 deletions
|
|
@ -1,6 +1,6 @@
|
|||
'use client'
|
||||
"use client"
|
||||
|
||||
import type { ReactNode } from "react"
|
||||
import type { ComponentProps, ReactNode } from "react"
|
||||
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Separator } from "@/components/ui/separator"
|
||||
|
|
@ -15,7 +15,7 @@ interface SiteHeaderProps {
|
|||
primaryAlignment?: "right" | "center"
|
||||
}
|
||||
|
||||
export function SiteHeader({
|
||||
function SiteHeaderBase({
|
||||
title,
|
||||
lead,
|
||||
primaryAction,
|
||||
|
|
@ -47,7 +47,7 @@ export function SiteHeaderPrimaryButton({
|
|||
children,
|
||||
className,
|
||||
...props
|
||||
}: React.ComponentProps<typeof Button>) {
|
||||
}: ComponentProps<typeof Button>) {
|
||||
return (
|
||||
<Button size="sm" className={cn("w-full sm:w-auto", className)} {...props}>
|
||||
{children}
|
||||
|
|
@ -59,7 +59,7 @@ export function SiteHeaderSecondaryButton({
|
|||
children,
|
||||
className,
|
||||
...props
|
||||
}: React.ComponentProps<typeof Button>) {
|
||||
}: ComponentProps<typeof Button>) {
|
||||
return (
|
||||
<Button size="sm" variant="outline" className={cn("w-full sm:w-auto", className)} {...props}>
|
||||
{children}
|
||||
|
|
@ -67,6 +67,12 @@ export function SiteHeaderSecondaryButton({
|
|||
)
|
||||
}
|
||||
|
||||
// Backward compatibility: attach as static members (client-only usage)
|
||||
;(SiteHeader as any).PrimaryButton = SiteHeaderPrimaryButton
|
||||
;(SiteHeader as any).SecondaryButton = SiteHeaderSecondaryButton
|
||||
type SiteHeaderComponent = ((props: SiteHeaderProps) => JSX.Element) & {
|
||||
PrimaryButton: typeof SiteHeaderPrimaryButton
|
||||
SecondaryButton: typeof SiteHeaderSecondaryButton
|
||||
}
|
||||
|
||||
export const SiteHeader: SiteHeaderComponent = Object.assign(SiteHeaderBase, {
|
||||
PrimaryButton: SiteHeaderPrimaryButton,
|
||||
SecondaryButton: SiteHeaderSecondaryButton,
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue