A decentralized music tracking and discovery platform built on AT Protocol 馃幍
at fix/spotify 69 lines 1.6 kB view raw
1import { Button } from "./Button"; 2import "./header.css"; 3 4type User = { 5 name: string; 6}; 7 8export interface HeaderProps { 9 user?: User; 10 onLogin?: () => void; 11 onLogout?: () => void; 12 onCreateAccount?: () => void; 13} 14 15export const Header = ({ 16 user, 17 onLogin, 18 onLogout, 19 onCreateAccount, 20}: HeaderProps) => ( 21 <header> 22 <div className="storybook-header"> 23 <div> 24 <svg 25 width="32" 26 height="32" 27 viewBox="0 0 32 32" 28 xmlns="http://www.w3.org/2000/svg" 29 > 30 <g fill="none" fillRule="evenodd"> 31 <path 32 d="M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z" 33 fill="#FFF" 34 /> 35 <path 36 d="M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z" 37 fill="#555AB9" 38 /> 39 <path 40 d="M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z" 41 fill="#91BAF8" 42 /> 43 </g> 44 </svg> 45 <h1>Acme</h1> 46 </div> 47 <div> 48 {user ? ( 49 <> 50 <span className="welcome"> 51 Welcome, <b>{user.name}</b>! 52 </span> 53 <Button size="small" onClick={onLogout} label="Log out" /> 54 </> 55 ) : ( 56 <> 57 <Button size="small" onClick={onLogin} label="Log in" /> 58 <Button 59 primary 60 size="small" 61 onClick={onCreateAccount} 62 label="Sign up" 63 /> 64 </> 65 )} 66 </div> 67 </div> 68 </header> 69);