pages/IconGuide.jsx
import TextEditIcon from '@/components/icons/TextEditIcon'
import UserAddIcon from '@/components/icons/UserAddIcon'
import FilterIcon from '@/components/icons/FilterIcon'
const iconSections = [
{
title: 'TextEditIcon',
examples: [
{
label: '기본',
icon: <TextEditIcon />,
code: '<TextEditIcon />',
},
{
label: 'size 32px',
icon: <TextEditIcon size={32} />,
code: '<TextEditIcon size={32} />',
},
{
label: 'stroke #fff active',
icon: (
<div className="flex h-10 w-10 items-center justify-center rounded-md" style={{backgroundColor:'#222'}}>
<TextEditIcon stroke="#ffffff" />
</div>
),
code: '<TextEditIcon stroke="#ffffff" />',
},
{
label: 'stroke #fff inactive',
icon: (
<div className="flex h-10 w-10 items-center justify-center rounded-md" style={{backgroundColor:'#E0E0E0'}}>
<TextEditIcon stroke="#ffffff" />
</div>
),
code: '<TextEditIcon stroke="#ffffff" />',
},
],
},
{
title: 'UserAddIcon',
examples: [
{
label: '기본',
icon: <UserAddIcon />,
code: '<UserAddIcon />',
},
{
label: 'size 32px',
icon: <UserAddIcon size={32} />,
code: '<UserAddIcon size={32} />',
},
{
label: 'stroke #fff active',
icon: (
<div className="flex h-10 w-10 items-center justify-center rounded-md" style={{backgroundColor:'#222'}}>
<UserAddIcon stroke="#ffffff" />
</div>
),
code: '<UserAddIcon stroke="#ffffff" />',
},
{
label: 'stroke #fff inactive',
icon: (
<div className="flex h-10 w-10 items-center justify-center rounded-md" style={{backgroundColor:'#e0e0e0'}}>
<UserAddIcon stroke="#ffffff" />
</div>
),
code: '<UserAddIcon stroke="#ffffff" />',
},
],
},
{
title: 'UserAddIcon',
examples: [
{
label: '기본',
icon: <FilterIcon />,
code: '<FilterIcon />',
},
{
label: 'stroke #fff active',
icon: (
<div className="flex h-10 w-10 items-center justify-center rounded-md" style={{backgroundColor:'#222'}}>
<FilterIcon stroke="#ffffff" fill="#222" />
</div>
),
code: '<FilterIcon stroke="#ffffff" fill="#222" />',
},
{
label: 'stroke #fff inactive',
icon: (
<div className="flex h-10 w-10 items-center justify-center rounded-md" style={{backgroundColor:'#e0e0e0'}}>
<FilterIcon stroke="#ffffff" fill="#e0e0e0" />
</div>
),
code: '<FilterIcon stroke="#ffffff" fill="#e0e0e0" />',
},
],
},
]
export default function IconGuide() {
return (
<section className="flex flex-col gap-8 p-6">
<div className="flex flex-col gap-2">
<h2 className="text-title-s">Icon</h2>
<p className="text-caption-m text-gray-600">size 미지정 시 기본 24px</p>
</div>
{iconSections.map(({ title, examples }) => (
<div key={title} className="flex flex-col gap-3">
<h3 className="text-body-s">{title}</h3>
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4">
{examples.map(({ label, icon, code }) => (
<div
key={label}
className="flex min-h-32 flex-col justify-between gap-4 rounded-lg border border-gray-200 p-4"
>
<div className="flex h-12 items-center justify-center">{icon}</div>
<div className="flex flex-col gap-1">
<strong className="text-body-s">{label}</strong>
<code className="break-all text-label-l text-gray-600">{code}</code>
</div>
</div>
))}
</div>
</div>
))}
</section>
)
}