type Category = "conversations" | "communities"; /** * Executes Switch. * @param props Parameter props. * @returns unknown. */ export default function Switch(props: { category: Category; setCategory: (category: Category) => void; }) { /** * Executes toggleCategory. * @param none This function has no parameters. * @returns unknown. */ function toggleCategory() { props.setCategory( props.category === "conversations" ? "communities" : "conversations", ); } return (
); }