feishin/src/renderer/features/shared/components/library-header-bar.tsx

56 lines
1,011 B
TypeScript
Raw Normal View History

2023-01-02 17:03:33 -08:00
import { ReactNode } from 'react';
import { Group } from '@mantine/core';
import { TextTitle } from '/@/renderer/components';
import { PlayButton as PlayBtn } from '/@/renderer/features/shared/components/play-button';
interface LibraryHeaderBarProps {
children: ReactNode;
}
export const LibraryHeaderBar = ({ children }: LibraryHeaderBarProps) => {
return (
<Group
noWrap
align="center"
h="100%"
px="1rem"
spacing="md"
2023-01-02 17:03:33 -08:00
>
{children}
</Group>
);
};
interface TitleProps {
children: ReactNode;
}
const Title = ({ children }: TitleProps) => {
return (
<TextTitle
2023-01-30 01:36:36 -08:00
order={1}
2023-01-02 17:03:33 -08:00
overflow="hidden"
weight={700}
2023-01-02 17:03:33 -08:00
>
{children}
</TextTitle>
);
};
interface PlayButtonProps {
onClick: () => void;
}
const PlayButton = ({ onClick }: PlayButtonProps) => {
2023-01-02 17:03:33 -08:00
return (
<PlayBtn
2023-02-05 20:52:25 -08:00
h="45px"
w="45px"
2023-01-02 17:03:33 -08:00
onClick={onClick}
/>
);
};
LibraryHeaderBar.Title = Title;
LibraryHeaderBar.PlayButton = PlayButton;