2023-04-06 16:18:26 +02:00
|
|
|
import { Maximize, Minus, X } from 'react-feather'
|
|
|
|
import { appWindow } from '@tauri-apps/api/window'
|
|
|
|
|
|
|
|
import { Image } from '../Image'
|
|
|
|
|
|
|
|
export const TitleBar: React.FC = () => {
|
|
|
|
return (
|
2023-04-20 17:56:29 +02:00
|
|
|
<nav className='flex w-full h-[40px] items-center justify-between bg-[#1f1f1f] text-white'>
|
|
|
|
<div
|
|
|
|
className='w-full select-none'
|
|
|
|
onMouseDown={async () => {
|
|
|
|
return await appWindow.startDragging()
|
|
|
|
}}>
|
|
|
|
<Image src='/Logo.svg' size={60} className='ml-3 p-1' />
|
|
|
|
</div>
|
2023-04-06 16:18:26 +02:00
|
|
|
|
|
|
|
<ul className='flex h-full'>
|
|
|
|
<li
|
2023-04-20 17:56:29 +02:00
|
|
|
className='grid h-full w-14 cursor-pointer place-items-center transition-colors duration-[10ms] hover:bg-[#2a2a2a]'
|
2023-04-06 16:18:26 +02:00
|
|
|
onClick={async () => {
|
|
|
|
return await appWindow.minimize()
|
2023-04-20 17:56:29 +02:00
|
|
|
}}>
|
2023-04-06 16:18:26 +02:00
|
|
|
<Minus />
|
|
|
|
</li>
|
2023-04-20 17:56:29 +02:00
|
|
|
|
|
|
|
<li className='grid h-full w-14 place-items-center cursor-not-allowed opacity-40'>
|
2023-04-06 16:18:26 +02:00
|
|
|
<Maximize size={20} />
|
|
|
|
</li>
|
2023-04-20 17:56:29 +02:00
|
|
|
|
2023-04-06 16:18:26 +02:00
|
|
|
<li
|
2023-04-20 17:56:29 +02:00
|
|
|
className='grid h-full w-14 cursor-pointer place-items-center transition-colors duration-[10ms] hover:bg-red-500'
|
2023-04-06 16:18:26 +02:00
|
|
|
onClick={async () => {
|
|
|
|
return await appWindow.close()
|
2023-04-20 17:56:29 +02:00
|
|
|
}}>
|
2023-04-06 16:18:26 +02:00
|
|
|
<X />
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
)
|
|
|
|
}
|