index.tsx 864 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import React from 'react';
  2. import Icon from '../Icon';
  3. import Typography from '../Typography';
  4. import { Wrapper } from './styled';
  5. import { Separator } from '../../global/otherStyled';
  6. import data from './data';
  7. type Props = {
  8. onClick: (state: string) => void;
  9. navbarState: string;
  10. children: React.ReactNode;
  11. };
  12. const Navbar: React.FunctionComponent<Props> = ({
  13. onClick,
  14. navbarState,
  15. children,
  16. }) => {
  17. return (
  18. <Wrapper>
  19. <Typography variant="title">Title</Typography>
  20. <Icon glyph="edit" />
  21. <Separator />
  22. {
  23. data.btnGroup.map((ele) => (
  24. <Icon
  25. key={ele.key}
  26. glyph={ele.content}
  27. isActive={navbarState === ele.content}
  28. onClick={() => { onClick(ele.content); }}
  29. />
  30. ))
  31. }
  32. {children}
  33. </Wrapper>
  34. );
  35. };
  36. export default Navbar;