mirror of
https://github.com/wassname/talk.git
synced 2026-08-13 12:40:11 +08:00
33 lines
818 B
JavaScript
33 lines
818 B
JavaScript
import React from 'react';
|
|
import withTags from './withTags';
|
|
import styles from './styles.css';
|
|
import cn from 'classnames';
|
|
import {t} from 'plugin-api/beta/client/services';
|
|
import {name} from '../../package.json';
|
|
import {Icon} from 'plugin-api/beta/client/components/ui';
|
|
|
|
const FeaturedButton = (props) => {
|
|
const {alreadyTagged, deleteTag, postTag} = props;
|
|
|
|
return (
|
|
<button
|
|
className={cn([name, styles.button, {[styles.featured] : alreadyTagged}])}
|
|
onClick={alreadyTagged ? deleteTag : postTag} >
|
|
|
|
{alreadyTagged ? (
|
|
<span>
|
|
{t('featured')} <Icon name="label" />
|
|
</span>
|
|
) : (
|
|
<span>
|
|
{t('feature')} <Icon name="label_outline" />
|
|
</span>
|
|
)}
|
|
|
|
</button>
|
|
);
|
|
};
|
|
|
|
export default withTags('featured')(FeaturedButton);
|
|
|