misc_pterodactyl-panel/resources/scripts/components/elements/Code.tsx

20 lines
533 B
TypeScript
Raw Normal View History

2022-11-25 20:25:03 +00:00
import * as React from 'react';
import classNames from 'classnames';
interface CodeProps {
dark?: boolean | undefined;
className?: string;
children: React.ReactChild | React.ReactFragment | React.ReactPortal;
}
export default ({ dark, className, children }: CodeProps) => (
<code
2023-01-12 19:31:47 +00:00
className={classNames('inline-block rounded px-2 py-1 font-mono text-sm', className, {
'bg-neutral-700': !dark,
'bg-neutral-900 text-slate-100': dark,
})}
>
{children}
</code>
);