DashboardHeader.jsx 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. Copyright (C) 2025 QuantumNous
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Affero General Public License as
  5. published by the Free Software Foundation, either version 3 of the
  6. License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Affero General Public License for more details.
  11. You should have received a copy of the GNU Affero General Public License
  12. along with this program. If not, see <https://www.gnu.org/licenses/>.
  13. For commercial licensing, please contact support@quantumnous.com
  14. */
  15. import React from 'react';
  16. import { Button } from '@douyinfe/semi-ui';
  17. import { RefreshCw, Search } from 'lucide-react';
  18. const DashboardHeader = ({
  19. getGreeting,
  20. greetingVisible,
  21. showSearchModal,
  22. refresh,
  23. loading,
  24. t,
  25. }) => {
  26. const ICON_BUTTON_CLASS = 'text-white hover:bg-opacity-80 !rounded-full';
  27. return (
  28. <div className='flex items-center justify-between mb-4'>
  29. <h2
  30. className='text-2xl font-semibold text-gray-800 transition-opacity duration-1000 ease-in-out'
  31. style={{ opacity: greetingVisible ? 1 : 0 }}
  32. >
  33. {getGreeting}
  34. </h2>
  35. <div className='flex gap-3'>
  36. <Button
  37. type='tertiary'
  38. icon={<Search size={16} />}
  39. onClick={showSearchModal}
  40. className={`bg-green-500 hover:bg-green-600 ${ICON_BUTTON_CLASS}`}
  41. />
  42. <Button
  43. type='tertiary'
  44. icon={<RefreshCw size={16} />}
  45. onClick={refresh}
  46. loading={loading}
  47. className={`bg-blue-500 hover:bg-blue-600 ${ICON_BUTTON_CLASS}`}
  48. />
  49. </div>
  50. </div>
  51. );
  52. };
  53. export default DashboardHeader;