web: delete dashboards

This commit is contained in:
Carl-Gerhard Lindesvärd
2023-12-12 21:55:42 +01:00
parent 61561e65c9
commit fc141a80e0
9 changed files with 129 additions and 31 deletions

View File

@@ -1,20 +1,48 @@
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuGroup,
DropdownMenuItem,
DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu';
import type { HtmlProps } from '@/types';
import { cn } from '@/utils/cn';
import { MoreHorizontal } from 'lucide-react';
type CardProps = HtmlProps<HTMLDivElement> & {
hover?: boolean;
};
export function Card({ children, hover }: CardProps) {
export function Card({ children, hover, className }: CardProps) {
return (
<div
className={cn(
'border border-border rounded',
hover &&
'transition-all hover:-translate-y-0.5 hover:shadow hover:border-black'
'border border-border rounded relative',
hover && 'transition-all hover:shadow hover:border-black',
className
)}
>
{children}
</div>
);
}
interface CardActionsProps {
children: React.ReactNode;
}
export function CardActions({ children }: CardActionsProps) {
return (
<div className="absolute top-2 right-2 z-10">
<DropdownMenu>
<DropdownMenuTrigger className="h-8 w-8 hover:border rounded justify-center items-center flex">
<MoreHorizontal size={16} />
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="w-[200px]">
<DropdownMenuGroup>{children}</DropdownMenuGroup>
</DropdownMenuContent>
</DropdownMenu>
</div>
);
}
export const CardActionsItem = DropdownMenuItem;