PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.10
Yatra – Travel Booking & Tour Operator Software v3.0.10
3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 2.0.10 All 83 releases
yatra / resources / js / components / common / PageHeader.tsx

PageHeader.tsx in Yatra – Travel Booking & Tour Operator Software 3.0.10, at resources/js/components/common/PageHeader.tsx

59 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Page Header Component
3 * Reusable header for all pages with title, description, and actions
4 * Supports role-based action visibility
5 */
6
7 import React from "react";
8 import { __ } from "../../lib/i18n";
9 import { ConditionalRender } from "../ui/conditional-render";
10
11 interface PageHeaderProps {
12 title?: string; // Optional - title is now shown in top bar
13 description?: string;
14 actions?: React.ReactNode;
15 actionCapability?: string;
16 actionRequirePro?: boolean;
17 }
18
19 /**
20 * Page Header Component
21 *
22 * @example
23 * <PageHeader
24 * title={__('Trips', 'yatra')}
25 * description={__('Manage your travel packages', 'yatra')}
26 * actionCapability="yatra_edit_trips"
27 * actions={<Button>Add New</Button>}
28 * />
29 */
30 export const PageHeader: React.FC<PageHeaderProps> = ({
31 description,
32 actions,
33 actionCapability,
34 actionRequirePro = false,
35 }) => {
36 return (
37 <div className="flex items-center justify-between mb-8">
38 <div>
39 {description && (
40 <p className="text-sm text-gray-500 dark:text-gray-400">
41 {description}
42 </p>
43 )}
44 </div>
45
46 {actions && (
47 <ConditionalRender
48 capability={actionCapability}
49 requirePro={actionRequirePro}
50 >
51 <div className="flex items-center gap-3">{actions}</div>
52 </ConditionalRender>
53 )}
54 </div>
55 );
56 };
57
58 export default PageHeader;
59