File size: 772 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import styled from '@emotion/styled';
import type { PropsWithChildren } from 'react';

const Row = styled.div< GridRowProps & React.HTMLAttributes< HTMLDivElement > >`
	display: -ms-grid;
	display: grid;
	width: 100%;
	-ms-grid-columns: ${ ( props ) => props.columnWidths.replace( ' ', ' ' + props.gap + ' ' ) };
	grid-template-columns: ${ ( props ) => props.columnWidths };
	grid-column-gap: ${ ( props ) => props.gap };
	justify-items: stretch;
`;

export default function GridRow( {
	gap,
	columnWidths,
	className,
	children,
}: PropsWithChildren< GridRowProps > ) {
	return (
		<Row gap={ gap } columnWidths={ columnWidths } className={ className }>
			{ children }
		</Row>
	);
}

interface GridRowProps {
	className?: string;
	gap: string;
	columnWidths: string;
}