mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-07-26 10:22:12 +00:00
feat(webapp): import preview page
This commit is contained in:
41
packages/webapp/src/components/Section/SectionCard.tsx
Normal file
41
packages/webapp/src/components/Section/SectionCard.tsx
Normal file
@@ -0,0 +1,41 @@
|
||||
import classNames from 'classnames';
|
||||
import * as React from 'react';
|
||||
import { DISPLAYNAME_PREFIX, HTMLDivProps, Props } from '@blueprintjs/core';
|
||||
import { CLASSES } from '@/constants';
|
||||
|
||||
export interface SectionCardProps
|
||||
extends Props,
|
||||
HTMLDivProps,
|
||||
React.RefAttributes<HTMLDivElement> {
|
||||
/**
|
||||
* Whether to apply visual padding inside the content container element.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
padded?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Section card component.
|
||||
*
|
||||
* @see https://blueprintjs.com/docs/#core/components/section.section-card
|
||||
*/
|
||||
export const SectionCard: React.FC<SectionCardProps> = React.forwardRef(
|
||||
(props, ref) => {
|
||||
const { className, children, padded, ...htmlProps } = props;
|
||||
const classes = classNames(
|
||||
CLASSES.SECTION_CARD,
|
||||
{ [CLASSES.PADDED]: padded },
|
||||
className,
|
||||
);
|
||||
return (
|
||||
<div className={classes} ref={ref} {...htmlProps}>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
);
|
||||
SectionCard.defaultProps = {
|
||||
padded: true,
|
||||
};
|
||||
SectionCard.displayName = `${DISPLAYNAME_PREFIX}.SectionCard`;
|
||||
Reference in New Issue
Block a user