15 lines
420 B
TypeScript
15 lines
420 B
TypeScript
|
|
import React from 'react'
|
||
|
|
import { AiOutlineLeft } from 'react-icons/ai';
|
||
|
|
import { useNavigate } from 'react-router-dom';
|
||
|
|
|
||
|
|
type HeaderProps = {
|
||
|
|
title?: React.ReactNode
|
||
|
|
}
|
||
|
|
|
||
|
|
export const Header: React.FC<HeaderProps> = ({ title }) => {
|
||
|
|
const navigate = useNavigate();
|
||
|
|
return <>
|
||
|
|
<h2 className="card-title" data-tauri-drag-region><button onClick={() => navigate('/')}><AiOutlineLeft /></button>{title}</h2>
|
||
|
|
</>
|
||
|
|
}
|