refactor(ui): organize component source tree
This commit is contained in:
parent
8927f2ab8a
commit
32ad2cebe4
66 changed files with 194 additions and 124 deletions
42
packages/ui/src/components/frames/FooterCell.tsx
Normal file
42
packages/ui/src/components/frames/FooterCell.tsx
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
import type { UiStatusItem } from "../../types";
|
||||
|
||||
export interface FooterCellProps {
|
||||
item: UiStatusItem;
|
||||
}
|
||||
|
||||
export function FooterCell({ item }: FooterCellProps) {
|
||||
const target = item.link?.external ? "_blank" : undefined;
|
||||
const rel = item.link?.external ? "noreferrer" : undefined;
|
||||
const content = (
|
||||
<>
|
||||
<span>{item.label}</span>
|
||||
<strong>{item.value}</strong>
|
||||
</>
|
||||
);
|
||||
|
||||
if (item.link) {
|
||||
return (
|
||||
<a
|
||||
className="footer-cell"
|
||||
data-severity={item.severity || "neutral"}
|
||||
data-model-id={item.id}
|
||||
href={item.link.href}
|
||||
target={target}
|
||||
rel={rel}
|
||||
aria-label={item.link.label}
|
||||
>
|
||||
{content}
|
||||
</a>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className="footer-cell"
|
||||
data-severity={item.severity || "neutral"}
|
||||
data-model-id={item.id}
|
||||
>
|
||||
{content}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue