component-library-mustafa-akagunduz
Version:
Air Command System projesi için geliştirilmiş React component kütüphanesi
3 lines (2 loc) • 5.08 kB
JavaScript
import{jsxs as e,jsx as C}from"react/jsx-runtime";import{clsx as a}from"../node_modules/clsx/dist/clsx.js";import{Button as n}from"./Button.js";import{LuMoon as r}from"../node_modules/react-icons/lu/index.js";const l=({user:l,currentTheme:t,currentLanguage:o,onThemeToggle:i,onLanguageChange:s,onLogout:c,themeIcon:m,t:d})=>e("nav",{className:a("navbar",{"navbar--dark":"dark"===t,"navbar--light":"light"===t}),children:[C("div",{className:"navbar__left",children:e("span",{className:"navbar__logo",children:[C("span",{className:"navbar__logo-bold",children:"AIR"}),"Command"]})}),e("div",{className:"navbar__right",children:[e("span",{className:"navbar__welcome",children:["tr"===o?"Hoş geldiniz":"Welcome"," ",l.fullName," (","tr"===o?"commander"===l.role?"Komutan":"observer"===l.role?"Gözlemci":l.role:l.role,")"]}),e("div",{className:"navbar__controls",children:[C("button",{type:"button",onClick:i,className:"navbar__theme-btn","aria-label":"tr"===o?"Tema değiştir":"Toggle theme",children:"light"===t?C(r,{size:16}):C("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:C("path",{d:"M8 11.6364C6.99394 11.6364 6.13649 11.2817 5.42764 10.5724C4.71879 9.86303 4.36412 9.00558 4.36364 8C4.36315 6.99442 4.71782 6.13697 5.42764 5.42764C6.13745 4.7183 6.99491 4.36364 8 4.36364C9.00509 4.36364 9.86279 4.7183 10.5731 5.42764C11.2834 6.13697 11.6378 6.99442 11.6364 8C11.6349 9.00558 11.2802 9.86327 10.5724 10.5731C9.86448 11.2829 9.00703 11.6373 8 11.6364ZM0.727275 8.72727C0.521214 8.72727 0.348608 8.65745 0.209457 8.51782C0.0703055 8.37818 0.000487356 8.20557 2.50784e-06 8C-0.00048234 7.79442 0.0693358 7.62182 0.209457 7.48218C0.349578 7.34255 0.522184 7.27273 0.727275 7.27273H2.18182C2.38788 7.27273 2.56073 7.34255 2.70036 7.48218C2.84 7.62182 2.90958 7.79442 2.90909 8C2.90861 8.20557 2.83879 8.37842 2.69964 8.51855C2.56049 8.65867 2.38788 8.72824 2.18182 8.72727H0.727275ZM13.8182 8.72727C13.6121 8.72727 13.4395 8.65745 13.3004 8.51782C13.1612 8.37818 13.0914 8.20557 13.0909 8C13.0904 7.79442 13.1602 7.62182 13.3004 7.48218C13.4405 7.34255 13.6131 7.27273 13.8182 7.27273H15.2727C15.4788 7.27273 15.6516 7.34255 15.7913 7.48218C15.9309 7.62182 16.0005 7.79442 16 8C15.9995 8.20557 15.9297 8.37842 15.7905 8.51855C15.6514 8.65867 15.4788 8.72824 15.2727 8.72727H13.8182ZM8 2.90909C7.79394 2.90909 7.62133 2.83927 7.48218 2.69964C7.34303 2.56 7.27321 2.3874 7.27273 2.18182V0.727275C7.27273 0.521214 7.34255 0.348608 7.48218 0.209457C7.62182 0.0703055 7.79442 0.000487356 8 2.50784e-06C8.20557 -0.00048234 8.37842 0.0693358 8.51855 0.209457C8.65867 0.349578 8.72824 0.522184 8.72727 0.727275V2.18182C8.72727 2.38788 8.65745 2.56073 8.51782 2.70036C8.37818 2.84 8.20557 2.90958 8 2.90909ZM8 16C7.79394 16 7.62133 15.9302 7.48218 15.7905C7.34303 15.6509 7.27321 15.4783 7.27273 15.2727V13.8182C7.27273 13.6121 7.34255 13.4395 7.48218 13.3004C7.62182 13.1612 7.79442 13.0914 8 13.0909C8.20557 13.0904 8.37842 13.1602 8.51855 13.3004C8.65867 13.4405 8.72824 13.6131 8.72727 13.8182V15.2727C8.72727 15.4788 8.65745 15.6516 8.51782 15.7913C8.37818 15.9309 8.20557 16.0005 8 16ZM3.38182 4.4L2.6 3.63636C2.45455 3.50303 2.38473 3.33333 2.39055 3.12727C2.39637 2.92121 2.46618 2.74546 2.6 2.6C2.74546 2.45455 2.92121 2.38182 3.12727 2.38182C3.33333 2.38182 3.50303 2.45455 3.63636 2.6L4.4 3.38182C4.53333 3.52727 4.6 3.69697 4.6 3.89091C4.6 4.08485 4.53333 4.25455 4.4 4.4C4.26667 4.54546 4.10012 4.61527 3.90036 4.60946C3.70061 4.60364 3.52776 4.53382 3.38182 4.4ZM12.3636 13.4L11.6 12.6182C11.4667 12.4727 11.4 12.3001 11.4 12.1004C11.4 11.9006 11.4667 11.7338 11.6 11.6C11.7333 11.4545 11.9001 11.385 12.1004 11.3913C12.3006 11.3976 12.4732 11.4672 12.6182 11.6L13.4 12.3636C13.5455 12.497 13.6153 12.6667 13.6095 12.8727C13.6036 13.0788 13.5338 13.2545 13.4 13.4C13.2545 13.5455 13.0788 13.6182 12.8727 13.6182C12.6667 13.6182 12.497 13.5455 12.3636 13.4ZM11.6 4.4C11.4545 4.26667 11.3847 4.10012 11.3905 3.90036C11.3964 3.70061 11.4662 3.52776 11.6 3.38182L12.3636 2.6C12.497 2.45455 12.6667 2.38473 12.8727 2.39055C13.0788 2.39637 13.2545 2.46618 13.4 2.6C13.5455 2.74546 13.6182 2.92121 13.6182 3.12727C13.6182 3.33333 13.5455 3.50303 13.4 3.63636L12.6182 4.4C12.4727 4.53333 12.303 4.6 12.1091 4.6C11.9151 4.6 11.7455 4.53333 11.6 4.4ZM2.6 13.4C2.45455 13.2545 2.38182 13.0788 2.38182 12.8727C2.38182 12.6667 2.45455 12.497 2.6 12.3636L3.38182 11.6C3.52727 11.4667 3.69988 11.4 3.89964 11.4C4.09939 11.4 4.26618 11.4667 4.4 11.6C4.54546 11.7333 4.61527 11.9001 4.60946 12.1004C4.60364 12.3006 4.53382 12.4732 4.4 12.6182L3.63636 13.4C3.50303 13.5455 3.33333 13.6153 3.12727 13.6095C2.92121 13.6036 2.74546 13.5338 2.6 13.4Z",fill:"white"})})}),C("button",{type:"button",onClick:()=>{s("tr"===o?"en":"tr")},className:"navbar__lang-btn","aria-label":"tr"===o?"Dil değiştir":"Change language",children:"tr"===o?"Tr":"En"}),C(n,{onClick:c,variant:"ghost",size:"small",className:"navbar__logout-btn",children:"tr"===o?"Çıkış Yap":"Logout"})]})]})]});export{l as Navbar};
//# sourceMappingURL=Navbar.js.map