PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.16
Yatra – Travel Booking & Tour Operator Software v3.0.16
3.0.16 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 All 84 releases
yatra / resources / js / components / dashboard / QuickActions.tsx

QuickActions.tsx in Yatra – Travel Booking & Tour Operator Software 3.0.16, at resources/js/components/dashboard/QuickActions.tsx

102 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Quick Actions Widget
3 * Provides quick access to common actions
4 */
5
6 import React from "react";
7 import { __ } from "../../lib/i18n";
8 import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
9 import { Button } from "../ui/button";
10 import { Plus, FileText, Calendar, BarChart3, Settings } from "lucide-react";
11 import { ConditionalRender } from "../ui/conditional-render";
12
13 interface QuickActionsProps {
14 onCreateTrip?: () => void;
15 onGenerateReport?: () => void;
16 onViewCalendar?: () => void;
17 onViewAnalytics?: () => void;
18 onViewSettings?: () => void;
19 }
20
21 /**
22 * Quick Actions Widget
23 */
24 export const QuickActions: React.FC<QuickActionsProps> = ({
25 onCreateTrip,
26 onGenerateReport,
27 onViewCalendar,
28 onViewAnalytics,
29 onViewSettings,
30 }) => {
31 const actions = [
32 {
33 label: __("Create New Trip", "yatra"),
34 icon: Plus,
35 onClick: onCreateTrip,
36 capability: "yatra_edit_trips",
37 color: "blue",
38 },
39 {
40 label: __("Generate Report", "yatra"),
41 icon: FileText,
42 onClick: onGenerateReport,
43 capability: "yatra_view_operational_reports",
44 color: "green",
45 },
46 {
47 label: __("View Calendar", "yatra"),
48 icon: Calendar,
49 onClick: onViewCalendar,
50 capability: "yatra_view_bookings",
51 color: "purple",
52 },
53 {
54 label: __("View Analytics", "yatra"),
55 icon: BarChart3,
56 onClick: onViewAnalytics,
57 capability: "yatra_view_operational_reports",
58 color: "orange",
59 },
60 {
61 label: __("Settings", "yatra"),
62 icon: Settings,
63 onClick: onViewSettings,
64 capability: "yatra_access_admin",
65 color: "gray",
66 },
67 ];
68
69 return (
70 <Card>
71 <CardHeader>
72 <CardTitle>{__("Quick Actions", "yatra")}</CardTitle>
73 </CardHeader>
74 <CardContent>
75 <div className="grid grid-cols-2 gap-2">
76 {actions.map((action) => (
77 <ConditionalRender
78 key={action.label}
79 capability={action.capability}
80 >
81 <Button
82 variant="outline"
83 className="flex flex-col items-center justify-center gap-1 h-16 hover:bg-gray-50 dark:hover:bg-gray-700"
84 onClick={action.onClick}
85 >
86 <action.icon
87 className={`w-4 h-4 text-${action.color}-600 dark:text-${action.color}-400`}
88 />
89 <span className="text-xs text-center leading-tight">
90 {action.label}
91 </span>
92 </Button>
93 </ConditionalRender>
94 ))}
95 </div>
96 </CardContent>
97 </Card>
98 );
99 };
100
101 export default QuickActions;
102