mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-21 01:01:17 -04:00
extract fake DOS terminal into a separate component
This commit is contained in:
18
components/Terminal/Terminal.tsx
Normal file
18
components/Terminal/Terminal.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import { forwardRef } from "react";
|
||||
import classNames from "classnames";
|
||||
import type { Ref, HTMLAttributes } from "react";
|
||||
|
||||
import styles from "./Terminal.module.css";
|
||||
|
||||
type Props = HTMLAttributes<HTMLDivElement>;
|
||||
|
||||
// a DOS-style terminal box with dynamic text
|
||||
const Terminal = forwardRef(function Terminal({ className, ...rest }: Props, ref: Ref<HTMLSpanElement>) {
|
||||
return (
|
||||
<div className={classNames("monospace", className, styles.terminal)} {...rest}>
|
||||
<span ref={ref} /> <span className={styles.blink} />
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
||||
export default Terminal;
|
Reference in New Issue
Block a user