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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | 1x 8x 8x | import React from "react";
import { PromotionHeader } from "./PromotionHeader";
import { StatsBar } from "./StatsBar";
import { ActionButtons, type ButtonConfig } from "./ActionButtons";
interface StickyHeaderProps {
title: string;
totalCount: number;
selectedCount: number;
onSelectAll: () => void;
onClearAll: () => void;
}
export const StickyHeader: React.FC<StickyHeaderProps> = ({
title,
totalCount,
selectedCount,
onSelectAll,
onClearAll,
}) => {
const actionButtons: ButtonConfig[] = [
{
label: "Select All",
onClick: onSelectAll,
variant: "primary",
},
{
label: "Clear All",
onClick: onClearAll,
variant: "secondary",
disabled: selectedCount === 0,
},
];
return (
<div className="sticky top-0 z-20 bg-white/80 backdrop-blur-xl border-b border-gray-200 shadow-sm">
<div className="px-4 py-5">
<PromotionHeader title={title} totalCount={totalCount} />
<StatsBar totalCount={totalCount} selectedCount={selectedCount} />
<ActionButtons buttons={actionButtons} />
</div>
</div>
);
};
|