Files
cstb-next/src/components/window/Card.tsx

44 lines
1.1 KiB
TypeScript
Raw Normal View History

2024-09-20 23:15:42 +08:00
import { ReactNode } from "react";
interface CardProps {
2024-09-21 00:25:31 +08:00
children?: ReactNode;
className?: string;
2024-09-20 23:15:42 +08:00
}
const Card = ({ children }: CardProps) => {
return (
<div
2024-09-27 15:03:52 +08:00
className="dark:from-black/10 dark:to-black/5 dark:border-white/[6%] px-4 pt-3 pb-4 flex flex-col gap-2 border w-full rounded-lg bg-gradient-to-br from-white/50 to-white/40 border-black/[6%]"
2024-09-20 23:15:42 +08:00
data-tauri-drag-region
>
{children}
</div>
);
};
const CardHeader = ({ children }: CardProps) => {
return (
<div className="flex items-center gap-2.5 tracking-wide">{children}</div>
);
};
const CardIcon = ({ children }: CardProps) => {
return (
<div className="flex gap-1.5 items-center font-semibold">{children}</div>
);
};
const CardTool = ({ children }: CardProps) => {
return (
<div className="flex items-center justify-end flex-grow gap-2">
{children}
</div>
);
};
const CardBody = ({ children }: CardProps) => {
2024-09-21 00:25:31 +08:00
return <div className="w-full h-full text-sm tracking-wide text-zinc-800">{children}</div>;
2024-09-20 23:15:42 +08:00
};
export { Card, CardHeader, CardIcon, CardTool, CardBody };