refactor: create and use Songs-Screen in sender
This commit is contained in:
1 parent
1a0f2614f2
commit
e51ff6e738
3 files changed
+68
-122
No files matched your search
+20
-12
@@ -1,14 +1,22 @@
|
||||
import { ReactNode } from "react";
|
||||
import { ReactNode, ComponentPropsWithoutRef } from "react";
|
||||
|
||||
export default function Card({title, children}: {title: string, children: ReactNode}) {
|
||||
return (
|
||||
<section className="p-5 flex flex-col justify-between">
|
||||
<h2 className="text-lg font-semibold mb-4 flex items-center gap-2">
|
||||
{title}
|
||||
</h2>
|
||||
<div>
|
||||
{children}
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
interface CardProps extends ComponentPropsWithoutRef<"section"> {
|
||||
title: string;
|
||||
children: ReactNode;
|
||||
}
|
||||
|
||||
export default function Card({ title, children, className = "", ...props }: CardProps) {
|
||||
return (
|
||||
<section
|
||||
className={`p-5 flex flex-col justify-between ${className}`}
|
||||
{...props}
|
||||
>
|
||||
<h2 className="text-lg font-semibold mb-4 flex items-center gap-2">
|
||||
{title}
|
||||
</h2>
|
||||
<div className="flex-1 min-h-0 flex flex-col">
|
||||
{children}
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user