<div className="bg-neutral-800/70">
<div className="absolute top-0 right-0">
```jsx
{secondaryAction && secondaryActionLabel && (
<Button
outline
disabled={disabled}
label={secondaryActionLabel}
onClick={handleSecondaryAction}
/>
)}
```
<div className="peer">
<input
type="text"
className="peer-focus:text-neutral-900
peer-placeholder-shown:scale-100
peer-placeholder-shown:translate-y-0
peer-focus:scale-75
peer-focus:-translate-y-4
"
/>
</div>
Props passed from the Server to Client Components need to be serializable. This means that values such as functions, Dates, etc, cannot be passed directly to Client Components.
To create a new type/interface by omitting an existing type/interface and changing a few properties.
export type SafeUser = Omit<
User,
"createdAt" | "updatedAt" | "emailVerified"
> & {
createdAt: string,
updatedAt: string,
emailVerified: string | null,
};
interface NavbarProps {
currentUser?: SafeUser | null;
}
const handleCategoryClick = useCallback(() => {
let currentQuery = {};
if (params) {
currentQuery = qs.parse(params.toString());
}
const updatedQuery: any = {
...currentQuery,
category: label,
};
if (params?.get("category") === label) {
delete updatedQuery.category;
}
const url = qs.stringifyUrl(
{
url: "/",
query: updatedQuery,
},
{ skipNull: true }
);
import countries from "world-countries";
const formattedCountries = countries.map((country) => ({
value: country.cca2,
label: country.name.common,
flag: country.flag,
latlng: country.latlng,
region: country.region,
}));
import dynamic from "next/dynamic";
const Map = dynamic(() => import("../Map"), {
ssr: false,
});
NOTE: 'important' property means that this style will override any other style that is applied to the element by default.
.rdrMonth {
width: 100% !important;
}
.rdrCalendarWrapper {
width: 100% !important;
font-size: 16px !important;
}