Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add "language" prop to CodeEditor #54

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ const code = `.container {
background-color: #f5f5f5;
}
`;
const language = 'CSS'

import CodeEditor from "@/cuicui/application-ui/code/code-card/code-card";

export const CodeCardPreview = () => {
return <CodeEditor code={code} />;
return <CodeEditor code={code} language={language} />;
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const CodeEditor = ({ code }: { code: string }) => {
const CodeEditor = ({ code, language }: { code: string, language: string }) => {
return (
<div className="group hover:-translate-x-1 max-w-md transform-gpu overflow-hidden rounded-2xl border border-neutral-500/15 bg-white shadow-sm transition-transform dark:bg-neutral-800">
<div className="flex items-end">
Expand All @@ -9,7 +9,7 @@ const CodeEditor = ({ code }: { code: string }) => {
textOrientation: "mixed",
}}
>
CSS
{language}
</span>
<div className="w-full transform-gpu rounded-2xl border-neutral-500/15 border-l bg-white px-4 py-2 shadow-lg shadow-neutral-600/20 transition-transform group-hover:translate-x-1 dark:bg-neutral-800 dark:shadow-neutral-900">
<pre className="pr-4">
Expand Down