()
| 17 | import { LogoTriggerdotdev } from "./Icons/LogoTriggerdotdev"; |
| 18 | |
| 19 | export function Header() { |
| 20 | const { doc } = useJsonDoc(); |
| 21 | |
| 22 | return ( |
| 23 | <header className="flex items-center justify-between w-screen h-[40px] bg-indigo-700 dark:bg-slate-800 border-b-[1px] border-slate-600"> |
| 24 | <div className="flex pl-2 gap-1 sm:gap-1.5 pt-0.5 h-8 justify-center items-center"> |
| 25 | <div className="w-20 sm:w-24"> |
| 26 | <Logo /> |
| 27 | </div> |
| 28 | <p className="text-slate-300 text-sm font-sans">by</p> |
| 29 | <LogoTriggerdotdev className="w-16 sm:w-20 opacity-80 hover:opacity-100 transition duration-300" /> |
| 30 | </div> |
| 31 | <DocumentTitle /> |
| 32 | <ol className="flex text-sm items-center gap-2 px-4"> |
| 33 | {!doc.readOnly && ( |
| 34 | <Form |
| 35 | method="delete" |
| 36 | onSubmit={(e) => |
| 37 | !confirm( |
| 38 | "This will permanantly delete this document from jsonhero.io, are you sure you want to continue?" |
| 39 | ) && e.preventDefault() |
| 40 | } |
| 41 | > |
| 42 | <button type="submit"> |
| 43 | <button className="flex items-center justify-center py-1 bg-slate-200 text-slate-800 bg-opacity-80 text-base font-bold px-2 rounded uppercase hover:cursor-pointer hover:bg-opacity-100 transition"> |
| 44 | <TrashIcon className="w-4 h-4 mr-0.5"></TrashIcon> |
| 45 | Delete |
| 46 | </button> |
| 47 | </button> |
| 48 | </Form> |
| 49 | )} |
| 50 | |
| 51 | <Popover> |
| 52 | <PopoverTrigger> |
| 53 | <button className="flex items-center justify-center bg-lime-500 text-slate-800 bg-opacity-90 text-base font-bold px-2 py-1 rounded uppercase hover:cursor-pointer hover:bg-opacity-100 transition"> |
| 54 | <PlusIcon className="w-4 h-4 mr-0.5"></PlusIcon> |
| 55 | New |
| 56 | </button> |
| 57 | </PopoverTrigger> |
| 58 | <PopoverContent side="bottom" sideOffset={8}> |
| 59 | <NewDocument /> |
| 60 | <PopoverArrow |
| 61 | className="fill-current text-indigo-700" |
| 62 | offset={20} |
| 63 | /> |
| 64 | </PopoverContent> |
| 65 | </Popover> |
| 66 | |
| 67 | <Popover> |
| 68 | <PopoverTrigger> |
| 69 | <button className="flex items-center justify-center py-1 bg-slate-200 text-slate-800 bg-opacity-90 text-base font-bold px-2 rounded uppercase hover:cursor-pointer hover:bg-opacity-100 transition"> |
| 70 | <ShareIcon className="w-4 h-4 mr-1"></ShareIcon> |
| 71 | Share |
| 72 | </button> |
| 73 | </PopoverTrigger> |
| 74 | <PopoverContent side="bottom" sideOffset={8}> |
| 75 | <Share /> |
| 76 | <PopoverArrow |
nothing calls this directly
no test coverage detected