All files / src/components/layout SectionHeader.tsx

0% Statements 0/3
0% Branches 0/5
0% Functions 0/1
0% Lines 0/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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                                                       
import React from "react";
 
interface SectionHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
  title: string;
  description?: string;
  actions?: React.ReactNode;
}
 
const SectionHeader = React.forwardRef<HTMLDivElement, SectionHeaderProps>(
  ({ title, description, actions, className = "", ...props }, ref) => (
    <div
      className={`mb-6 flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between sm:gap-6 ${className}`}
      ref={ref}
      {...props}
    >
      <div>
        <h2 className="mb-1.5">{title}</h2>
        {description && <p className="text-ink-soft prose-measure">{description}</p>}
      </div>
      {actions && <div className="flex w-full shrink-0 flex-wrap gap-2 sm:w-auto">{actions}</div>}
    </div>
  )
);
SectionHeader.displayName = "SectionHeader";
 
export { SectionHeader };
export type { SectionHeaderProps };