mirror of
https://github.com/koodiklinikka/koodiklinikka.fi.git
synced 2026-02-26 01:57:08 +00:00
tune styles and add secondary channel listing
This commit is contained in:
17
components/ChannelReferenceRenderer.tsx
Normal file
17
components/ChannelReferenceRenderer.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
export const ChannelReferenceRenderer = (props: { value: string }) => {
|
||||
return (
|
||||
<>
|
||||
{props.value.split(/(<#[A-Z0-9]+\|[A-Za-z0-9]+>)/).map((str) => {
|
||||
const matches = str.match(/<#([A-Z0-9]+)\|([A-Za-z0-9]+)>/);
|
||||
if (matches) {
|
||||
return (
|
||||
<a href={`https://app.slack.com/client/T03BQ3NU9/${matches[1]}`}>
|
||||
#{matches[2]}
|
||||
</a>
|
||||
);
|
||||
}
|
||||
return str;
|
||||
})}
|
||||
</>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user