import { useState, useEffect } from 'react'
import { appWindow } from '@tauri-apps/api/window'
function MinimizeIcon() {
return (
)
}
function MaximizeIcon() {
return (
)
}
function RestoreIcon() {
return (
)
}
function CloseIcon() {
return (
)
}
export default function TitleBar() {
const [isMaximized, setIsMaximized] = useState(false)
useEffect(() => {
appWindow.isMaximized().then(setIsMaximized)
let unlisten: (() => void) | undefined
appWindow.onResized(() => {
appWindow.isMaximized().then(setIsMaximized)
}).then((fn) => { unlisten = fn })
return () => { unlisten?.() }
}, [])
return (
)
}