-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChip.js
More file actions
19 lines (15 loc) · 731 Bytes
/
Chip.js
File metadata and controls
19 lines (15 loc) · 731 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"use client";
import { motion } from "framer-motion";
import importedStyles from "./Chip.module.css";
export default function Chip(props) {
const children = props.children;
const onClick = props.onClick;
const style = props.style;
const styles = props.styles || importedStyles;
const theme = props.theme;
return (
<motion.div className={styles.chip + (onClick ? " " + styles.chip_clickable : "") + (theme === "primary" ? " " + styles.chip_primary : "") + (theme === "secondary" ? " " + styles.chip_secondary : "")} onClick={onClick} style={style} transition={onClick ? { type: "spring", stiffness: 500 } : undefined} whileHover={onClick ? { scale: 1.03 } : undefined}>
{children}
</motion.div>
);
}