feat: add custom feed integration

This commit is contained in:
moonrailgun 2024-06-29 09:04:19 +08:00
parent 478d0c2af3
commit 765cc41c06

View File

@ -1,5 +1,5 @@
import React from 'react';
import { LuGithub } from 'react-icons/lu';
import { LuGithub, LuPlug } from 'react-icons/lu';
import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover';
import { CodeBlock } from '../CodeBlock';
import { useTranslation } from '@i18next-toolkit/react';
@ -10,7 +10,7 @@ export const FeedIntegration: React.FC<{
const { t } = useTranslation();
return (
<div className="flex flex-wrap p-2">
<div className="flex flex-wrap justify-center gap-2 p-2">
<FeedIntegrationItem
icon={<LuGithub size={32} />}
label="Github"
@ -28,6 +28,33 @@ export const FeedIntegration: React.FC<{
</div>
}
/>
<FeedIntegrationItem
icon={<LuPlug size={32} />}
label="Custom"
content={
<div>
<div className="text-lg font-bold">{t('Custom Request')}</div>
<div>{t('Send POST request to')}:</div>
<CodeBlock
code={`POST ${window.location.origin}/open/feed/${props.feedId}/send
Body
{
eventName: "",
eventContent: "",
tags: [],
source: "",
senderId: "",
senderName: "",
important: false,
}`}
/>
</div>
}
/>
</div>
);
});