Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
seleniumhq
GitHub Repository: seleniumhq/selenium
Path: blob/trunk/javascript/grid-ui/src/components/EnhancedTableToolbar.tsx
2885 views
1
// Licensed to the Software Freedom Conservancy (SFC) under one
2
// or more contributor license agreements. See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership. The SFC licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License. You may obtain a copy of the License at
8
//
9
// http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied. See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
18
import React from 'react'
19
import Toolbar from '@mui/material/Toolbar'
20
import Typography from '@mui/material/Typography'
21
import Box from '@mui/material/Box'
22
23
interface EnhancedTableToolbarProps {
24
title: string
25
children?: JSX.Element
26
}
27
28
function EnhancedTableToolbar (props: EnhancedTableToolbarProps) {
29
const {
30
title,
31
children
32
} = props
33
34
return (
35
<Toolbar sx={{ paddingLeft: 2, paddingRight: 1 }}>
36
<Typography
37
textAlign='center'
38
sx={{ flex: '1 1 100%' }}
39
variant='h3'
40
id='tableTitle'
41
component='div'
42
>
43
<Box
44
component='span'
45
display='flex'
46
alignItems='center'
47
>
48
<Box
49
component='span'
50
display='flex'
51
justifyContent='center'
52
flex={1}
53
>
54
{title}
55
</Box>
56
{children}
57
</Box>
58
</Typography>
59
</Toolbar>
60
)
61
}
62
63
export default EnhancedTableToolbar
64
65