Spaces:
Running
Running
File size: 1,359 Bytes
92c8d86 |
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 32 33 34 35 36 37 38 39 |
import classNames from "classnames";
import { TiHeartFullOutline } from "react-icons/ti";
import { MdCalendarToday } from "react-icons/md";
interface Props {
value: "likes" | "createdAt";
onChange: (s: "createdAt" | "likes") => void;
}
export const Sort = ({ value, onChange }: Props) => {
return (
<div className="flex items-center justify-center border-[3px] rounded-full border-gray-50 drop-shadow-sm bg-gray-100 ring-[1px] ring-gray-200 gap-1">
<button
className={classNames(
"rounded-full pl-3 pr-4 py-2.5 transition-all duration-200 font-semibold text-xs hover:bg-gray-200/70 flex items-center justify-center gap-2",
{
"bg-black hover:!bg-black text-white": value === "likes",
}
)}
onClick={() => onChange("likes")}
>
<TiHeartFullOutline className="w-3.5 h-3.5" />
Likes
</button>
<button
className={classNames(
"rounded-full pl-3 pr-4 py-2.5 transition-all duration-200 font-semibold text-xs hover:bg-gray-200/70 flex items-center justify-center gap-2",
{
"bg-black hover:!bg-black text-white": value === "createdAt",
}
)}
onClick={() => onChange("createdAt")}
>
<MdCalendarToday className="w-3.5 h-3.5" />
Date
</button>
</div>
);
};
|