* Chore disable git submodule for web-client and app-backend * Chore add newest source code of app-backend and web-client --------- Co-authored-by: Hien To <tominhhien97@gmail.com>
35 lines
790 B
TypeScript
35 lines
790 B
TypeScript
import React, { useState } from "react";
|
|
import Image from "next/image";
|
|
|
|
type Props = {
|
|
icon: string;
|
|
title: string;
|
|
expand: boolean;
|
|
onTitleClick: () => void;
|
|
};
|
|
|
|
const TogglableHeader: React.FC<Props> = ({
|
|
icon,
|
|
title,
|
|
expand,
|
|
onTitleClick,
|
|
}) => (
|
|
<button className="flex items-center justify-between" onClick={onTitleClick}>
|
|
<div className="flex items-center gap-2">
|
|
<Image src={icon} width={24} height={24} alt="" />
|
|
<span className="text-sm leading-5 font-semibold text-gray-900">
|
|
{title}
|
|
</span>
|
|
</div>
|
|
<Image
|
|
className={`${!expand ? "rotate-180" : "rotate-0"}`}
|
|
src={"/icons/unicorn_angle-up.svg"}
|
|
width={24}
|
|
height={24}
|
|
alt=""
|
|
/>
|
|
</button>
|
|
);
|
|
|
|
export default React.memo(TogglableHeader);
|