client,server folders

This commit is contained in:
2024-06-14 13:54:55 +05:00
parent e67512bd6d
commit 158f081b5f
649 changed files with 228 additions and 162 deletions
+28
View File
@@ -0,0 +1,28 @@
import { ISwitcher } from "../types/switcher";
interface ISwitchProps {
switcher: ISwitcher;
onClick: ((id: string) => void) | (() => void);
}
const Switch = ({ switcher, onClick }: ISwitchProps) => {
function handleOnClick() {
onClick(switcher.id);
}
return (
<div
className={`w-10 h-6 relative rounded-full cursor-pointer transition-all duration-300 ease-in-out ${
switcher.isSwitched ? "bg-[#00BED7]" : "bg-[#E2E2DC]"
}`}
onClick={handleOnClick}
>
<div
className={`w-5 h-5 bg-[#fff] rounded-full absolute transition-all duration-300 ease-in-out top-[2px]
${switcher.isSwitched ? "left-[18px]" : "left-[2px]"}`}
></div>
</div>
);
};
export default Switch;