-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDataTabHeader.tsx
34 lines (32 loc) · 961 Bytes
/
DataTabHeader.tsx
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
33
34
import { Col, Row, Typography } from 'antd';
import { usePlugin } from 'flipper-plugin';
import React from 'react';
import { plugin } from '..';
import { SortedObjectSchema } from '../CommonTypes';
import { ObjectAdd } from './objectManipulation/ObjectAdd';
import { RealmQueryInput } from './Query';
type InputType = {
currentSchema: SortedObjectSchema;
totalObjects: number;
};
export const DataTabHeader = ({ currentSchema, totalObjects }: InputType) => {
const { executeQuery } = usePlugin(plugin);
return (
<Row gutter={[8, 8]}>
<Col span={24}>
<RealmQueryInput execute={executeQuery} />
</Col>
{currentSchema ?<Typography.Text
style={{
padding: 10,
paddingLeft: 20,
fontWeight: 500,
color: '#70757a',
}}
>
{totalObjects} {currentSchema.name} objects
</Typography.Text> : null}
<ObjectAdd schema={currentSchema} />
</Row>
);
};