mirror of
https://github.com/koodiklinikka/koodiklinikka.fi.git
synced 2026-01-26 11:23:58 +00:00
* render channel list dynamically based on channel activity * rename slack message markdown transformer * add hashtag before rendered channel names * tune styles and add secondary channel listing * remove emoji-dictionary
18 lines
465 B
TypeScript
18 lines
465 B
TypeScript
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;
|
|
})}
|
|
</>
|
|
);
|
|
};
|