Spaces:
Configuration error
Configuration error
Download src/components/layout/Grid.tsx from SreejithSHR/umami: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/spaces/SreejithSHR/umami/resolve/main/src/components/layout/Grid.tsx
- Command line
-
hf download hf://spaces/SreejithSHR/umami/src/components/layout/Grid.tsx
-
curl -L -o Grid.tsx https://huggingface.co/spaces/SreejithSHR/umami/resolve/main/src/components/layout/Grid.tsx
1.02 kB
| import { CSSProperties } from 'react'; | |
| import classNames from 'classnames'; | |
| import { mapChildren } from 'react-basics'; | |
| // eslint-disable-next-line css-modules/no-unused-class | |
| import styles from './Grid.module.css'; | |
| export interface GridProps { | |
| className?: string; | |
| style?: CSSProperties; | |
| children?: any; | |
| } | |
| export function Grid({ className, style, children }: GridProps) { | |
| return ( | |
| <div className={classNames(styles.grid, className)} style={style}> | |
| {children} | |
| </div> | |
| ); | |
| } | |
| export function GridRow(props: { | |
| [x: string]: any; | |
| columns?: 'one' | 'two' | 'three' | 'one-two' | 'two-one' | 'compare'; | |
| className?: string; | |
| children?: any; | |
| }) { | |
| const { columns = 'two', className, children, ...otherProps } = props; | |
| return ( | |
| <div {...otherProps} className={classNames(styles.row, className, { [styles[columns]]: true })}> | |
| {mapChildren(children, child => { | |
| return <div className={classNames(styles.col, { [styles[columns]]: true })}>{child}</div>; | |
| })} | |
| </div> | |
| ); | |
| } | |