/** @jsxImportSource @emotion/react */ "use client"; import { Padding, TouchableOpacity } from "@/@dble_layout"; import onScrollToNextRef from "@/libs/handler/onScrollToRef"; import { useRef } from "react"; type Types = { children?: null[]; minWidth?: number; key?: string | number; id?: string | number; name: string; checked?: boolean; onClick?: () => void; isPathIcon?: boolean; icon?: React.ReactNode; isFocus?: boolean; }; export default function TagSwitch({ key, id, name, checked, onClick, isPathIcon = false, icon, isFocus = true, minWidth, }: Types) { const tabRef = useRef(null); return ( { onClick?.(); if (isFocus) onScrollToNextRef(tabRef); }} justify="center" align="center" gap={4} padding={{ vertical: 5, horizontal: 8 }} minW={minWidth} border={{ stroke: 1, color: checked ? "#4581e2" : "#e2e2e2", radius: 12 }} fill={checked ? "#4581e2" : "transparent"} txtColor={checked ? "#fff" : "#979eb0"} txtSize={13} > {icon} {name} {isPathIcon && ( )} ); }