Moved @tensamin/ui out of monorepo
This commit is contained in:
parent
60635d07c2
commit
39aa70a9a6
62 changed files with 309 additions and 3320 deletions
|
|
@ -3,7 +3,7 @@ import {
|
|||
Format,
|
||||
requestPermissions,
|
||||
} from "@tauri-apps/plugin-barcode-scanner";
|
||||
import { Button } from "@tensamin/ui/cmp/button";
|
||||
import { Button } from "@tensamin/ui";
|
||||
|
||||
import { toast } from "@tensamin/shared/log";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,53 +0,0 @@
|
|||
import { Maximize, Minus, X } from "lucide-react";
|
||||
import { Button } from "@tensamin/ui/cmp/button";
|
||||
|
||||
import { isTauri } from "@tauri-apps/api/core";
|
||||
import { getCurrentWindow } from "@tauri-apps/api/window";
|
||||
import { cn, useIsMobile } from "@tensamin/ui/utils";
|
||||
import { Card } from "@tensamin/ui/cmp/card";
|
||||
|
||||
export default function Controls({
|
||||
className,
|
||||
notPresentClassName,
|
||||
}: {
|
||||
className?: string;
|
||||
notPresentClassName?: string;
|
||||
}) {
|
||||
const isMobile = useIsMobile();
|
||||
if (!isTauri() || isMobile) return <div className={notPresentClassName} />;
|
||||
|
||||
const currentWindow = getCurrentWindow();
|
||||
|
||||
return (
|
||||
<Card
|
||||
className={cn(
|
||||
"flex flex-row py-0 px-0 p-0.5 gap-0 rounded-lg",
|
||||
className,
|
||||
)}
|
||||
>
|
||||
<>
|
||||
<Button
|
||||
variant="ghost"
|
||||
className="w-9 h-9 aspect-square rounded-lg"
|
||||
onClick={() => currentWindow.minimize()}
|
||||
>
|
||||
<Minus />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
className="w-9 h-9 aspect-square rounded-lg"
|
||||
onClick={() => currentWindow.toggleMaximize()}
|
||||
>
|
||||
<Maximize />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
className="w-9 h-9 aspect-square rounded-lg"
|
||||
onClick={() => currentWindow.close()}
|
||||
>
|
||||
<X />
|
||||
</Button>
|
||||
</>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue