import React, { PropsWithChildren } from "react"; import { twMerge } from "tailwind-merge"; export type TWUITabsObject = { title: string; value: string; content: React.ReactNode; defaultActive?: boolean; }; export type TWUI_TOGGLE_PROPS = PropsWithChildren & React.DetailedHTMLProps< React.HTMLAttributes, HTMLDivElement > & { color?: "normal" | "secondary" | "error" | "success" | "gray"; variant?: "normal" | "outlined" | "ghost"; href?: string; newTab?: boolean; linkProps?: React.DetailedHTMLProps< React.AnchorHTMLAttributes, HTMLAnchorElement >; }; /** * # Tabs Component * @className twui-tag * @className twui-tag-primary-outlined */ export default function Tag({ color, variant, children, href, newTab, linkProps, ...props }: TWUI_TOGGLE_PROPS) { const mainComponent = (
{children}
); if (href) { return ( {mainComponent} ); } return mainComponent; }