import clsx from "clsx"; import { motion } from "framer-motion"; import React from "react"; type IconType = (props: React.ComponentProps<"svg">) => JSX.Element; type Props = { status: boolean; onChange: (status: boolean) => void; texts: [string, string]; icons: [IconType, IconType]; }; export const Toggle: React.FC = ({ texts: [onText, offText], icons: [OnIcon, OffIcon], status, onChange, }) => { const CurrentIcon = status ? OnIcon : OffIcon; return ( onChange(!status)} > {status ? onText : offText} ); };