forked from pterodactyl/panel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTitledGreyBox.tsx
More file actions
29 lines (26 loc) · 914 Bytes
/
Copy pathTitledGreyBox.tsx
File metadata and controls
29 lines (26 loc) · 914 Bytes
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
import React from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { IconProp } from '@fortawesome/fontawesome-svg-core';
interface Props {
icon?: IconProp;
title: string | React.ReactNode;
className?: string;
children: React.ReactNode;
}
const TitledGreyBox = ({ icon, title, children, className }: Props) => (
<div className={`rounded shadow-md bg-neutral-700 ${className}`}>
<div className={'bg-neutral-900 rounded-t p-3 border-b border-black'}>
{typeof title === 'string' ?
<p className={'text-sm uppercase'}>
{icon && <FontAwesomeIcon icon={icon} className={'mr-2 text-neutral-300'}/>}{title}
</p>
:
title
}
</div>
<div className={'p-3'}>
{children}
</div>
</div>
);
export default TitledGreyBox;