import { HTMLAttributes, ReactNode } from 'react';
import { Button } from '@chakra-ui/react';
import { IoAdd } from '@react-icons/all-files/io5/IoAdd';
import { cx } from '../../../common/utils/styleUtils';
import style from './PanelUtils.module.scss';
export function Header({ children }: { children: ReactNode }) {
return
{children}
;
}
export function SubHeader({ children }: { children: ReactNode }) {
return {children}
;
}
export function Title({ children }: { children: ReactNode }) {
return {children}
;
}
type AllowedTags = 'div' | 'form';
type SectionProps = {
as?: C;
children: ReactNode;
} & JSX.IntrinsicElements[C];
export function Section({ as, className, children, ...props }: SectionProps) {
const Element = as ?? 'div';
return (
)}>
{children}
);
}
export function Indent({ as, className, children, ...props }: SectionProps) {
const Element = as ?? 'div';
return (
)}>
{children}
);
}
export function Paragraph({ children }: { children: ReactNode }) {
return {children}
;
}
export function Card({ children, className, ...props }: { children: ReactNode } & JSX.IntrinsicElements['div']) {
return (
{children}
);
}
export function Table({ className, children }: { className?: string; children: ReactNode }) {
const classes = cx([style.table, className]);
return (
);
}
export function TableEmpty({ handleClick }: { handleClick: () => void }) {
return (
|
No data yet
} size='sm'>
New
|
);
}
export function ListGroup({ className, children }: { className?: string; children: ReactNode }) {
return ;
}
export function ListItem({ children }: { children: ReactNode }) {
return {children};
}
export function Field({ title, description, error }: { title: string; description: string; error?: string }) {
return (
{title}
{error && {error}}
{!error && description && {description}}
);
}
export function Description({ children }: { children: ReactNode }) {
return {children}
;
}
export function Highlight({ children }: { children: ReactNode }) {
return {children};
}
export function BlockQuote({ children }: { children: ReactNode }) {
return {children}
;
}
export function Error({ children }: { children: ReactNode }) {
return {children}
;
}
export function Divider() {
return
;
}
export function Loader({ isLoading }: { isLoading: boolean }) {
if (!isLoading) {
return null;
}
return (
);
}