refactor(ui): extract reusable component package
This commit is contained in:
parent
87261b5a3f
commit
2664804e91
86 changed files with 102 additions and 85 deletions
19
packages/ui/src/components/Panel.tsx
Normal file
19
packages/ui/src/components/Panel.tsx
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import type { PropsWithChildren } from "react";
|
||||
|
||||
export interface PanelProps extends PropsWithChildren {
|
||||
title?: string;
|
||||
density?: "compact" | "dense";
|
||||
}
|
||||
|
||||
export function Panel({ title, density = "dense", children }: PanelProps) {
|
||||
return (
|
||||
<section className="panel" data-density={density}>
|
||||
{title ? (
|
||||
<header className="panel__header">
|
||||
<h2>{title}</h2>
|
||||
</header>
|
||||
) : null}
|
||||
<div className="panel__body">{children}</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue