Spaces:
Sleeping
Sleeping
Download src/components/Header.js from srijan9994/node-ui: direct link, hf CLI and curl.
- Browser
- Download file 901 Bytes
-
https://huggingface.co/spaces/srijan9994/node-ui/resolve/main/src/components/Header.js
- Command line
-
hf download hf://spaces/srijan9994/node-ui/src/components/Header.js
-
curl -L -o Header.js https://huggingface.co/spaces/srijan9994/node-ui/resolve/main/src/components/Header.js
901 Bytes
| import React from "react"; | |
| const Header = ({ user, onLogout }) => { | |
| return ( | |
| <div | |
| style={{ | |
| display: "flex", | |
| justifyContent: "space-between", | |
| alignItems: "center", | |
| padding: "10px 20px", | |
| backgroundColor: "#333", | |
| color: "#fff", | |
| }} | |
| > | |
| <h3>Chat with Llama3.2:3b</h3> | |
| {user && ( | |
| <div style={{ display: "flex", alignItems: "center", gap: "15px" }}> | |
| <span>Welcome, {user.name || user.username}</span> | |
| <button | |
| onClick={onLogout} | |
| style={{ | |
| padding: "8px 15px", | |
| border: "none", | |
| backgroundColor: "#ff4d4d", | |
| color: "#fff", | |
| borderRadius: "5px", | |
| cursor: "pointer", | |
| }} | |
| > | |
| Logout | |
| </button> | |
| </div> | |
| )} | |
| </div> | |
| ); | |
| }; | |
| export default Header; | |