File size: 759 Bytes
b24b684
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import { Box, Stack, Typography } from "@mui/material";
import type { ReactNode } from "react";

interface Props {
  title: string;
  subtitle?: string;
  action?: ReactNode;
}

export default function PageHeader({ title, subtitle, action }: Props) {
  return (
    <Stack

      direction={{ xs: "column", sm: "row" }}

      justifyContent="space-between"

      alignItems={{ xs: "flex-start", sm: "center" }}

      spacing={2}

      sx={{ mb: 3 }}

    >

      <Box>

        <Typography variant="h4">{title}</Typography>

        {subtitle && (

          <Typography variant="body2" color="text.secondary" sx={{ mt: 0.5 }}>

            {subtitle}

          </Typography>

        )}

      </Box>

      {action}

    </Stack>
  );
}