26 lines
480 B
TypeScript
26 lines
480 B
TypeScript
import { DiscussionEmbed } from "disqus-react";
|
|
|
|
export interface DisqusConfig {
|
|
provider: "disqus";
|
|
pages?: Array<string>;
|
|
config: {
|
|
shortname: string;
|
|
};
|
|
}
|
|
|
|
export type DisqusProps = DisqusConfig["config"] & {
|
|
slug?: string;
|
|
};
|
|
|
|
export const Disqus: React.FC<DisqusProps> = ({ shortname, slug }) => {
|
|
return (
|
|
<DiscussionEmbed
|
|
shortname={shortname}
|
|
config={{
|
|
url: window?.location?.href,
|
|
identifier: slug,
|
|
}}
|
|
/>
|
|
);
|
|
};
|