All checks were successful
Dev Build / build-test (pull_request) Successful in 2m10s
19 lines
428 B
TypeScript
19 lines
428 B
TypeScript
interface ColorSwatchProps {
|
|
colorHex: string
|
|
size?: number
|
|
}
|
|
|
|
export default function ColorSwatch({ colorHex, size = 24 }: ColorSwatchProps) {
|
|
return (
|
|
<div
|
|
className="rounded-full border border-slate-600 shadow-sm inline-block"
|
|
style={{
|
|
backgroundColor: colorHex.startsWith('#') ? colorHex : `#${colorHex}`,
|
|
width: size,
|
|
height: size,
|
|
}}
|
|
title={colorHex}
|
|
/>
|
|
)
|
|
}
|