Skip to content

Commit

Permalink
this should fix it
Browse files Browse the repository at this point in the history
  • Loading branch information
DarhkVoyd committed Nov 7, 2024
1 parent a342ee6 commit bf23b58
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions pages/tools/components/ui/Tag.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
import React, { ReactNode } from 'react';
import classNames from 'classnames';
import classnames from 'classnames';

interface TagProps {
children: ReactNode;
intent?: 'success' | 'warning' | 'error' | 'neutral';
}

const Tag = ({ children, intent = 'neutral' }: TagProps) => {
const appliedStyle = classNames(
'inline-block rounded-full mr-2 px-3 py-1 text-[12px] font-semibold',
{
'bg-green-50 text-green-700 border border-green-300':
intent === 'success',
'bg-yellow-50 text-yellow-700 border border-yellow-300':
intent === 'warning',
'bg-red-50 text-red-700 border border-red-300': intent === 'error',
'bg-gray-50 text-gray-700 border border-gray-300': intent === 'neutral',
},
return (
<div
className={classnames(
'inline-block rounded-full mr-2 px-3 py-1 text-[12px] font-semibold',
{
'bg-green-50 text-green-700 border border-green-300':
intent === 'success',
'bg-yellow-50 text-yellow-700 border border-yellow-300':
intent === 'warning',
'bg-red-50 text-red-700 border border-red-300': intent === 'error',
'bg-gray-50 text-gray-700 border border-gray-300':
intent === 'neutral',
},
)}
>
{children}
</div>
);

return <div className={appliedStyle}>{children}</div>;
};

export default Tag;

0 comments on commit bf23b58

Please sign in to comment.